Files
Jyotisha/deploy/docker-compose.server.yml
T
jesse-uxandGrok (agent loop) 53d8df257d 给内测补上每日加密备份、宕机告警和日志上限。
主机安装和一次恢复演练留给产品。页面没有变化。

Co-Authored-By: Grok (agent loop)
2026-10-15 12:58:34 +08:00

93 lines
2.4 KiB
YAML

services:
api:
image: ${API_IMAGE:-jyotisha-api:local}
build:
context: ..
dockerfile: deploy/railway-api.Dockerfile
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "20m"
max-file: "10"
env_file:
- ${APP_ENV_FILE:-../.env.production}
environment:
PORT: 5200
GITHUB_SHA: ${GITHUB_SHA}
JYOTISH_ALLOWED_HOSTS: localhost,127.0.0.1,::1,api
expose:
- "5200"
healthcheck:
test: ["CMD", "python", "-c", "import urllib.request; urllib.request.urlopen('http://127.0.0.1:5200/api/health', timeout=3)"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
start_interval: 1s
volumes:
# WORKDIR is /app (deploy/railway-api.Dockerfile). Chart cache, async job
# files, and high-rigor job records live under scratch/local. Named volume
# is created on first use; previous overlay data was ephemeral.
- api_scratch:/app/scratch/local
web:
image: ${WEB_IMAGE:-jyotisha-web:local}
build:
context: ..
dockerfile: deploy/railway-web.Dockerfile
args:
NEXT_PUBLIC_SUPABASE_URL: ${NEXT_PUBLIC_SUPABASE_URL:-}
NEXT_PUBLIC_SUPABASE_ANON_KEY: ${NEXT_PUBLIC_SUPABASE_ANON_KEY:-}
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "20m"
max-file: "10"
env_file:
- ${APP_ENV_FILE:-../.env.production}
environment:
GITHUB_SHA: ${GITHUB_SHA}
PORT: 3000
JYOTISH_API_BASE: http://api:5200
expose:
- "3000"
healthcheck:
test: ["CMD", "node", "-e", "fetch('http://127.0.0.1:3000/api/health').then(r=>{if(!r.ok)process.exit(1)})"]
interval: 30s
timeout: 5s
retries: 5
start_period: 30s
start_interval: 1s
depends_on:
api:
condition: service_healthy
caddy:
image: caddy:2-alpine
restart: unless-stopped
logging:
driver: json-file
options:
max-size: "20m"
max-file: "10"
environment:
SITE_ADDRESS: ${SITE_ADDRESS:-https://jyotisha.chat}
ports:
- "80:80"
- "443:443"
- "443:443/udp"
volumes:
- ${CADDYFILE_PATH:-./Caddyfile}:/etc/caddy/Caddyfile:ro
- caddy_data:/data
- caddy_config:/config
depends_on:
web:
condition: service_healthy
volumes:
caddy_data:
caddy_config:
api_scratch: