version: '3.8' services: postgres: image: postgres:15-alpine environment: POSTGRES_DB: compai POSTGRES_USER: postgres POSTGRES_PASSWORD: postgres ports: - "5432:5432" volumes: - pgdata:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U postgres"] interval: 5s timeout: 5s retries: 5 redis: image: redis:7-alpine ports: - "6379:6379" healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 5s retries: 5 backend: build: context: . dockerfile: docker/Dockerfile.backend environment: - DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/compai - REDIS_URL=redis://redis:6379/0 - CELERY_BROKER_URL=redis://redis:6379/1 - CELERY_RESULT_BACKEND=redis://redis:6379/1 ports: - "8000:8000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy worker: build: context: . dockerfile: docker/Dockerfile.worker environment: - DATABASE_URL=postgresql+asyncpg://postgres:postgres@postgres:5432/compai - REDIS_URL=redis://redis:6379/0 - CELERY_BROKER_URL=redis://redis:6379/1 - CELERY_RESULT_BACKEND=redis://redis:6379/1 depends_on: postgres: condition: service_healthy redis: condition: service_healthy frontend: build: context: . dockerfile: docker/Dockerfile.frontend ports: - "80:80" depends_on: - backend volumes: pgdata: