services: app: build: context: . dockerfile: Dockerfile restart: always environment: - ENVIRONMENT=prod - POSTGRES_HOST=postgres - REDIS_HOST=redis - QDRANT_HOST=qdrant env_file: - .env ports: - "8000:8000" depends_on: postgres: condition: service_healthy redis: condition: service_healthy qdrant: condition: service_started command: uvicorn src.main:app --host 0.0.0.0 --port 8000 --workers 2 healthcheck: test: ["CMD", "curl", "-f", "http://localhost:8000/health"] interval: 30s timeout: 10s retries: 3 start_period: 20s worker: build: context: . dockerfile: Dockerfile restart: always environment: - ENVIRONMENT=prod - POSTGRES_HOST=postgres - REDIS_HOST=redis - QDRANT_HOST=qdrant env_file: - .env depends_on: postgres: condition: service_healthy redis: condition: service_healthy qdrant: condition: service_started command: python -m src.workers.message_processor postgres: image: postgres:16-alpine restart: always environment: POSTGRES_USER: ${POSTGRES_USER:-crm_user} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB:-fashion_crm} volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-crm_user} -d ${POSTGRES_DB:-fashion_crm}"] interval: 10s timeout: 5s retries: 5 # Do NOT expose port 5432 externally in production redis: image: redis:7-alpine restart: always command: redis-server --appendonly yes --requirepass ${REDIS_PASSWORD:-} volumes: - redis_data:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 10s timeout: 3s retries: 5 # Do NOT expose port 6379 externally in production qdrant: image: qdrant/qdrant:latest restart: always volumes: - qdrant_data:/qdrant/storage environment: QDRANT__SERVICE__GRPC_PORT: 6334 # Do NOT expose ports externally in production volumes: postgres_data: redis_data: qdrant_data: