services: api: image: ${DOCKER_IMAGE:-solution-api}:${TAG:-latest} build: context: . dockerfile: Dockerfile restart: always ports: - "8000:8000" volumes: - ./:/app environment: - DATABASE_URL=postgresql+asyncpg://user:password@db:5432/dbname - REDIS_URL=redis://redis:6379/0 depends_on: db: condition: service_healthy redis: condition: service_healthy networks: - shop-network - default db: image: postgres:15-alpine environment: - POSTGRES_USER=user - POSTGRES_PASSWORD=password - POSTGRES_DB=dbname ports: - "5433:5432" healthcheck: test: ["CMD-SHELL", "pg_isready -U user -d dbname"] interval: 5s timeout: 5s retries: 5 networks: - default redis: image: redis:7-alpine ports: - "6380:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 networks: - default networks: shop-network: external: true