name: llmgateway-prod
services:
# Gateway Service
gateway:
image: ghcr.io/theopenco/llmgateway-gateway:latest
container_name: llmgateway-gateway
restart: unless-stopped
ports:
- "${GATEWAY_PORT:-4001}:80"
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- llmgateway-network
environment:
- NODE_ENV=production
- PORT=80
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-llmgateway}
- REDIS_HOST=redis
- REDIS_PORT=6379
- REDIS_PASSWORD=${REDIS_PASSWORD}
- LLM_OPENAI_API_KEY=${LLM_OPENAI_API_KEY}
- LLM_ANTHROPIC_API_KEY=${LLM_ANTHROPIC_API_KEY}
# API Service
api:
image: ghcr.io/theopenco/llmgateway-api:latest
container_name: llmgateway-api
restart: unless-stopped
ports:
- "${API_PORT:-4002}:80"
depends_on:
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- llmgateway-network
environment:
- NODE_ENV=production
- RUN_MIGRATIONS=true
- PORT=80
- DATABASE_URL=postgres://${POSTGRES_USER:-postgres}:${POSTGRES_PASSWORD}@postgres:5432/${POSTGRES_DB:-llmgateway}
- UI_URL=${UI_URL:-http://localhost:3002}
- API_URL=${API_URL:-http://localhost:4002}
- ORIGIN_URLS=${ORIGIN_URLS}
- COOKIE_DOMAIN=${COOKIE_DOMAIN:-localhost}
- PASSKEY_RP_ID=${PASSKEY_RP_ID:-localhost}
- PASSKEY_RP_NAME=${PASSKEY_RP_NAME:-LLMGateway}
- AUTH_SECRET=${AUTH_SECRET}
- GITHUB_CLIENT_ID=${GITHUB_CLIENT_ID}
- GITHUB_CLIENT_SECRET=${GITHUB_CLIENT_SECRET}
- STRIPE_SECRET_KEY=${STRIPE_SECRET_KEY}
- STRIPE_WEBHOOK_SECRET=${STRIPE_WEBHOOK_SECRET}
# UI Service
ui:
image: ghcr.io/theopenco/llmgateway-ui:latest
container_name: llmgateway-ui
restart: unless-stopped
ports:
- "${UI_PORT:-3002}:80"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- llmgateway-network
environment:
- API_URL=${API_URL:-http://localhost:4002}
- API_BACKEND_URL=http://api:80
- PLAYGROUND_URL=${PLAYGROUND_URL:-http://localhost:3003}
- DOCS_URL=${DOCS_URL:-http://localhost:3005}
# Playground Service
playground:
image: ghcr.io/theopenco/llmgateway-playground:latest
container_name: llmgateway-playground
restart: unless-stopped
ports:
- "${PLAYGROUND_PORT:-3003}:80"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- llmgateway-network
environment:
- API_URL=${API_URL:-http://localhost:4002}
- API_BACKEND_URL=http://api:80
# Admin Service
admin:
image: ghcr.io/theopenco/llmgateway-admin:latest
container_name: llmgateway-admin
restart: unless-stopped
ports:
- "${ADMIN_PORT:-3006}:80"
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://localhost:80/"]
interval: 30s
timeout: 10s
retries: 3
networks:
- llmgateway-network
environment:
- API_URL=${API_URL:-http://localhost:4002}
- API_BACKEND_URL=http://api:80
# PostgreSQL Database
postgres:
platform: linux/amd64
image: postgres:17-alpine
container_name: llmgateway-postgres
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-postgres}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB:-llmgateway}
volumes:
- postgres_data:/var/lib/postgresql/data
ports:
- "${POSTGRES_PORT:-5432}:5432"
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-postgres}"]
interval: 10s
timeout: 5s
retries: 5
networks:
- llmgateway-network
# Redis for caching and queues
redis:
image: redis:8-alpine
platform: linux/amd64
container_name: llmgateway-redis
restart: unless-stopped
command: ["redis-server", "--appendonly", "yes", "--requirepass", "${REDIS_PASSWORD}"]
volumes:
- redis_data:/data
ports:
- "${REDIS_PORT:-6379}:6379"
healthcheck:
test: ["CMD", "redis-cli", "--raw", "incr", "ping"]
interval: 10s
timeout: 3s
retries: 5
networks:
- llmgateway-network
volumes:
postgres_data:
driver: local
redis_data:
driver: local
networks:
llmgateway-network:
driver: bridge