Files
trumpsignal-backend/docker-compose.yml
T
2026-04-21 20:17:50 +08:00

46 lines
1.3 KiB
YAML

services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: trumpsignal
POSTGRES_USER: $SERVICE_USER_POSTGRES
POSTGRES_PASSWORD: $SERVICE_PASSWORD_POSTGRES
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U $SERVICE_USER_POSTGRES -d trumpsignal"]
interval: 5s
timeout: 5s
retries: 20 # up to 100s total wait
start_period: 20s # don't count failures during first 20s of startup
api:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql+asyncpg://${SERVICE_USER_POSTGRES}:${SERVICE_PASSWORD_POSTGRES}@db:5432/trumpsignal
FRONTEND_URL: ${FRONTEND_URL}
ENCRYPTION_KEY: ${ENCRYPTION_KEY}
AI_API_KEY: ${AI_API_KEY}
AI_BASE_URL: ${AI_BASE_URL:-https://api.gptsapi.net/v1}
AI_MODEL: ${AI_MODEL:-claude-sonnet-4-6}
HL_MAINNET: ${HL_MAINNET:-true}
ENVIRONMENT: ${ENVIRONMENT:-production}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 15s
timeout: 5s
retries: 5
start_period: 30s
volumes:
postgres_data:
api_data: