62 lines
1.7 KiB
YAML
62 lines
1.7 KiB
YAML
name: wq-alpha
|
|
services:
|
|
db:
|
|
image: postgres:17-alpine
|
|
environment:
|
|
POSTGRES_USER: wq
|
|
POSTGRES_DB: wq
|
|
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:?Run scripts/init_env.py first}
|
|
volumes:
|
|
- postgres_data:/var/lib/postgresql/data
|
|
healthcheck:
|
|
test: [CMD-SHELL, "pg_isready -U wq -d wq"]
|
|
interval: 5s
|
|
timeout: 5s
|
|
retries: 20
|
|
restart: unless-stopped
|
|
backend:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.backend
|
|
environment:
|
|
DATABASE_URL: postgresql+asyncpg://wq:${POSTGRES_PASSWORD:?required}@db:5432/wq
|
|
ADMIN_USERNAME: ${ADMIN_USERNAME:-admin}
|
|
ADMIN_PASSWORD: ${ADMIN_PASSWORD:?required}
|
|
ENCRYPTION_KEY: ${ENCRYPTION_KEY:?required}
|
|
PUBLIC_ORIGIN: http://localhost:${LOCAL_PORT:-8080}
|
|
AI_REQUEST_LIMIT: ${AI_REQUEST_LIMIT:-6}
|
|
AI_TOOL_LIMIT: ${AI_TOOL_LIMIT:-12}
|
|
AI_OUTPUT_TOKENS: ${AI_OUTPUT_TOKENS:-4096}
|
|
AI_TIMEOUT: ${AI_TIMEOUT:-180}
|
|
COOKIE_SECURE: "false"
|
|
WQ_BASE_URL: ${WQ_BASE_URL:-https://api.worldquantbrain.com}
|
|
depends_on:
|
|
db:
|
|
condition: service_healthy
|
|
healthcheck:
|
|
test: [CMD, python, -c, "import urllib.request; urllib.request.urlopen('http://127.0.0.1:8000/api/v1/health', timeout=3)"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 12
|
|
start_period: 20s
|
|
restart: unless-stopped
|
|
web:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile.frontend
|
|
environment:
|
|
SITE_ADDRESS: http://:80
|
|
ports:
|
|
- "127.0.0.1:${LOCAL_PORT:-8080}:80"
|
|
volumes:
|
|
- caddy_data:/data
|
|
- caddy_config:/config
|
|
depends_on:
|
|
backend:
|
|
condition: service_healthy
|
|
restart: unless-stopped
|
|
volumes:
|
|
postgres_data:
|
|
caddy_data:
|
|
caddy_config:
|