48 lines
1.2 KiB
YAML
48 lines
1.2 KiB
YAML
services:
|
|
zhinian-aigc:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
image: zhinian-aigc:latest
|
|
container_name: zhinian-aigc
|
|
restart: unless-stopped
|
|
env_file:
|
|
- .env.local
|
|
environment:
|
|
NODE_ENV: production
|
|
PORT: 3000
|
|
ZHINIAN_RUNTIME_DIR: /app/.runtime
|
|
NEXT_TELEMETRY_DISABLED: "1"
|
|
ports:
|
|
- "${APP_PORT:-3000}:3000"
|
|
volumes:
|
|
- ./.runtime:/app/.runtime
|
|
healthcheck:
|
|
test:
|
|
- CMD
|
|
- node
|
|
- -e
|
|
- "fetch('http://127.0.0.1:3000/api/health').then((r)=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))"
|
|
interval: 30s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 20s
|
|
|
|
zhinian-worker:
|
|
image: zhinian-aigc:latest
|
|
container_name: zhinian-worker
|
|
restart: unless-stopped
|
|
depends_on:
|
|
zhinian-aigc:
|
|
condition: service_healthy
|
|
env_file:
|
|
- .env.local
|
|
environment:
|
|
NODE_ENV: production
|
|
ZHINIAN_RUNTIME_DIR: /app/.runtime
|
|
NEXT_TELEMETRY_DISABLED: "1"
|
|
ZHINIAN_WORKER_BASE_URL: http://zhinian-aigc:3000
|
|
volumes:
|
|
- ./.runtime:/app/.runtime
|
|
command: ["node", "scripts/worker.mjs"]
|