version: '3.9' services: app: build: . ports: - "8000:8000" volumes: - .:/app environment: DATABASE_URL: postgres://user:pass@db:5432/appdb REDIS_URL: redis://cache:6379/0 depends_on: db: condition: service_healthy cache: condition: service_started db: image: postgres:16-alpine environment: POSTGRES_USER: user POSTGRES_PASSWORD: pass POSTGRES_DB: appdb volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U user -d appdb"] interval: 5s retries: 5 cache: image: redis:7-alpine command: redis-server --save "" --appendonly no volumes: pgdata: