fetch_ml/deployments/docker-compose.test.yml
Jeremie Fraeys 98a0d42213
deploy: consolidate docker-compose files using profiles
- Merge logs-debug.yml into test.yml with 'debug' profile
- Merge local.yml into dev.yml with 'local' profile
- Merge prod.smoke.yml into prod.yml with 'smoke' profile
- Reduces compose files from 8 to 5, simplifies maintenance
- Update TEST_COMPOSE to use deployments/docker-compose.test.yml
2026-03-04 13:22:17 -05:00

74 lines
1.7 KiB
YAML

---
# Docker Compose for test infrastructure (Redis + SSH test server)
# Used by make test-e2e to provide consistent test environment
services:
redis:
image: redis:7-alpine
ports:
- "6379:6379"
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 1s
timeout: 3s
retries: 10
start_period: 2s
ssh-test-server:
image: linuxserver/openssh-server:latest
ports:
- "2222:2222"
environment:
- PUID=1000
- PGID=1000
- TZ=Etc/UTC
- USER_NAME=testuser
- USER_PASSWORD=testpass
- SUDO_ACCESS=true
- PASSWORD_ACCESS=true
volumes:
- ssh-config:/config
healthcheck:
test: ["CMD-SHELL", "nc -z localhost 2222 || exit 1"]
interval: 2s
timeout: 3s
retries: 15
start_period: 5s
# Debug profile: API server for logs/debug e2e tests
api-server:
image: golang:1.25-bookworm
profiles: ["debug"]
working_dir: /app
command: >
sh -c "
go build -o api-server ./cmd/api-server/main.go &&
./api-server --config /app/configs/api/dev.yaml
"
ports:
- "9102:9101"
environment:
- LOG_LEVEL=debug
- REDIS_ADDR=redis:6379
volumes:
- ../../:/app
- api-logs:/logs
- api-experiments:/data/experiments
- api-active:/data/active
- go-mod-cache:/go/pkg/mod
depends_on:
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "-q", "--spider", "http://localhost:9101/health"]
interval: 5s
timeout: 3s
retries: 10
start_period: 30s
volumes:
ssh-config:
api-logs:
api-experiments:
api-active:
go-mod-cache: