Use Case
Docker Compose deploy scripts have outdated config and missing resilience settings, causing deprecation warnings and potential startup race conditions.
Proposed Solution
-
Remove version: '3.9' from docker-compose.yml and docker-compose.dev.yml
- Obsolete in Docker Compose V2, emits a warning on every run
-
Use depends_on with health conditions in docker-compose.yml
depends_on:
db:
condition: service_healthy
redis:
condition: service_healthy
-
Add healthcheck for Redis in docker-compose.yml
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
-
Add restart: unless-stopped to app service for production
Alternatives Considered
N/A
Implementation Notes
- Files affected:
docker/docker-compose.yml, docker/docker-compose.dev.yml
- The entrypoint.sh Postgres wait loop can be kept as a fallback, but
service_healthy should be the primary mechanism
Use Case
Docker Compose deploy scripts have outdated config and missing resilience settings, causing deprecation warnings and potential startup race conditions.
Proposed Solution
Remove
version: '3.9'fromdocker-compose.ymlanddocker-compose.dev.ymlUse
depends_onwith health conditions indocker-compose.ymlAdd healthcheck for Redis in
docker-compose.ymlAdd
restart: unless-stoppedtoappservice for productionAlternatives Considered
N/A
Implementation Notes
docker/docker-compose.yml,docker/docker-compose.dev.ymlservice_healthyshould be the primary mechanism