services: db: image: postgres:16-alpine container_name: orchestrator-db environment: POSTGRES_USER: ${POSTGRES_USER:-orchestrator} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?POSTGRES_PASSWORD must be set} POSTGRES_DB: ${POSTGRES_DB:-orchestrator} ports: - "5434:5432" # Port 5434 to avoid conflict with Hub Postgres (5432) and other services volumes: - postgres_data:/var/lib/postgresql/data healthcheck: test: ["CMD-SHELL", "pg_isready -U orchestrator -d orchestrator"] interval: 5s timeout: 5s retries: 5 api: image: code.letsbe.solutions/letsbe/orchestrator:latest container_name: orchestrator-api restart: unless-stopped ports: - "127.0.0.1:8100:8000" environment: DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-orchestrator}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB:-orchestrator} DEBUG: "false" APP_NAME: "LetsBe Orchestrator" ADMIN_API_KEY: "${ADMIN_API_KEY}" depends_on: db: condition: service_healthy healthcheck: # Use Python (curl not available in slim images) test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8000/health')"] interval: 5s timeout: 5s retries: 10 start_period: 10s volumes: postgres_data: