services: postgres: image: postgres:16-alpine environment: POSTGRES_USER: ${POSTGRES_USER:-octopus} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-octopus_dev_password} POSTGRES_DB: ${POSTGRES_DB:-octopus} ports: - "5432:5432" volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-octopus}"] interval: 10s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 5s retries: 5 api: build: context: ./services/api env_file: - .env ports: - "8000:8000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy volumes: postgres_data: