build(GOV-009): 对齐应用部署与运行入口

This commit is contained in:
2026-08-13 17:56:37 +08:00
parent 4665336a63
commit c771a98d4d
16 changed files with 311 additions and 75 deletions
+29 -6
View File
@@ -4,27 +4,50 @@ name: a-share-analysis-production
services:
web:
image: ${A_SHARE_WEB_IMAGE:?必须提供不可变 Web 镜像引用}
env_file: ${A_SHARE_WEB_ENV_FILE:-/etc/a-share-analysis/web.env}
ports:
- "127.0.0.1:8080:80"
- '127.0.0.1:8080:80'
depends_on:
api:
condition: service_healthy
healthcheck:
test: ['CMD', 'wget', '-q', '-O', '/dev/null', 'http://127.0.0.1/']
interval: 30s
timeout: 3s
retries: 3
start_period: 5s
restart: unless-stopped
api:
image: ${A_SHARE_SERVER_IMAGE:?必须提供不可变 Server 镜像引用}
command: ["node", "dist/apps/api/main.js"]
command: ['node', 'dist/apps/api/main.js']
env_file: ${A_SHARE_API_ENV_FILE:-/etc/a-share-analysis/api.env}
environment:
# 容器网络需要对 Web 服务可达;源码部署模板仍只监听回环地址。
API_HOST: 0.0.0.0
ports:
- "127.0.0.1:3000:3000"
- '127.0.0.1:3000:3000'
healthcheck:
test:
[
'CMD',
'node',
'-e',
"fetch('http://127.0.0.1:3000/api/v1/health').then(r=>{if(!r.ok)process.exit(1)}).catch(()=>process.exit(1))",
]
interval: 30s
timeout: 5s
retries: 3
start_period: 10s
restart: unless-stopped
scheduler:
image: ${A_SHARE_SERVER_IMAGE:?必须提供不可变 Server 镜像引用}
command: ["node", "dist/apps/scheduler/main.js"]
command: ['node', 'dist/apps/scheduler/main.js']
env_file: ${A_SHARE_SCHEDULER_ENV_FILE:-/etc/a-share-analysis/scheduler.env}
restart: unless-stopped
worker:
image: ${A_SHARE_SERVER_IMAGE:?必须提供不可变 Server 镜像引用}
command: ["node", "dist/apps/worker/main.js"]
command: ['node', 'dist/apps/worker/main.js']
env_file: ${A_SHARE_WORKER_ENV_FILE:-/etc/a-share-analysis/worker.env}
restart: unless-stopped