Files
lijiaoqiao/supply-api/deploy/docker-compose.yml

42 lines
996 B
YAML
Raw Normal View History

# Supply API Integration Test Infrastructure
# Usage: docker-compose -f deploy/docker-compose.yml up -d
# Then run: go test -tags=integration ./internal/middleware/...
version: '3.8'
services:
postgres:
image: postgres:15-alpine
container_name: supply-api-test-postgres
environment:
POSTGRES_USER: supply_test
POSTGRES_PASSWORD: supply_test_pass
POSTGRES_DB: supply_test
ports:
- "5432:5432"
volumes:
- postgres_test_data:/var/lib/postgresql/data
- ../sql/postgresql:/docker-entrypoint-initdb.d
healthcheck:
test: ["CMD-SHELL", "pg_isready -U supply_test"]
interval: 5s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
container_name: supply-api-test-redis
ports:
- "6379:6379"
volumes:
- redis_test_data:/data
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 5s
retries: 5
volumes:
postgres_test_data:
redis_test_data: