# 应用镜像和启动入口将在 Web/Server 脚手架落地后验证。本文件先固定生产配置边界。 name: a-share-analysis-production services: web: image: ${A_SHARE_WEB_IMAGE:?必须提供不可变 Web 镜像引用} ports: - '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'] 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' 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'] 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'] env_file: ${A_SHARE_WORKER_ENV_FILE:-/etc/a-share-analysis/worker.env} restart: unless-stopped