name: agentic-os services: postgres: image: postgres:16-alpine restart: unless-stopped environment: POSTGRES_USER: ${POSTGRES_USER} POSTGRES_PASSWORD: ${POSTGRES_PASSWORD} POSTGRES_DB: ${POSTGRES_DB} volumes: - ./data/postgres:/var/lib/postgresql/data - ./docker/postgres-init:/docker-entrypoint-initdb.d:ro healthcheck: test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"] interval: 5s timeout: 5s retries: 10 ports: - "5432:5432" redis: image: redis:7-alpine restart: unless-stopped command: ["redis-server", "--appendonly", "yes"] volumes: - redisdata:/data healthcheck: test: ["CMD", "redis-cli", "ping"] interval: 5s timeout: 3s retries: 10 litellm: image: ghcr.io/berriai/litellm:main-stable restart: unless-stopped depends_on: postgres: condition: service_healthy environment: OPENROUTER_API_KEY: ${OPENROUTER_API_KEY} DEEPSEEK_API_KEY: ${DEEPSEEK_API_KEY} GEMINI_API_KEY: ${GEMINI_API_KEY} OLLAMA_BASE_URL: http://host.docker.internal:11434 LITELLM_MASTER_KEY: ${LITELLM_MASTER_KEY} # Valid postgres URL (Prisma rejects asyncpg/+asyncpg URLs from backend .env) DATABASE_URL: postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgres:5432/litellm STORE_MODEL_IN_DB: "False" command: ["--config", "/app/config.yaml", "--port", "4000"] volumes: - ./litellm/config.yaml:/app/config.yaml:ro extra_hosts: - "host.docker.internal:host-gateway" ports: - "4000:4000" backend: build: context: . dockerfile: backend/Dockerfile restart: unless-stopped env_file: .env depends_on: postgres: condition: service_healthy redis: condition: service_healthy extra_hosts: - "host.docker.internal:host-gateway" volumes: - mcp_runtime:/runtime - ./mcp-servers:/app/mcp-servers:ro - ./rules:/app/rules - ./skills:/app/skills ports: - "8000:8000" command: ["uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "8000"] worker: build: context: . dockerfile: backend/Dockerfile restart: unless-stopped env_file: .env depends_on: postgres: condition: service_healthy redis: condition: service_healthy extra_hosts: - "host.docker.internal:host-gateway" volumes: - mcp_runtime:/runtime - ./mcp-servers:/app/mcp-servers:ro - ./rules:/app/rules - ./skills:/app/skills command: ["python", "-m", "app.worker"] frontend: build: context: ./frontend args: NEXT_PUBLIC_API_BASE_URL: ${NEXT_PUBLIC_API_BASE_URL} restart: unless-stopped env_file: .env depends_on: - backend ports: - "3000:3000" volumes: redisdata: mcp_runtime: