for deploy

This commit is contained in:
k
2026-04-21 19:41:11 +08:00
parent 3268080401
commit 3056635a5c
5 changed files with 115 additions and 14 deletions
+47
View File
@@ -0,0 +1,47 @@
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_DB: trumpsignal
POSTGRES_USER: trumpsignal
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
volumes:
- postgres_data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U trumpsignal"]
interval: 5s
timeout: 5s
retries: 10
api:
build: .
restart: unless-stopped
depends_on:
db:
condition: service_healthy
ports:
- "8000:8000"
environment:
DATABASE_URL: postgresql+asyncpg://trumpsignal:${POSTGRES_PASSWORD}@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}
volumes:
# Persist SQLite only if you're still using it (dev fallback).
# In production with Postgres this volume isn't needed.
- api_data:/app/data
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8000/api/health"]
interval: 15s
timeout: 5s
retries: 5
volumes:
postgres_data:
api_data: