# 邮件预报 — 预构建镜像部署(服务器不编译,省内存) # 镜像须先在开发机 build 并 docker load # 用法:bash deploy/install-prebuilt-image.sh [镜像tar路径] name: yx-bt-prebuilt services: web: image: yubao-app:latest pull_policy: never restart: unless-stopped # 不走 entrypoint:db push 已由 install-prebuilt-image.sh 完成,避免 Windows CRLF 导致 set -e 失败 command: ["pnpm", "start"] env_file: - ../.env environment: NODE_ENV: production COOKIE_SECURE: ${COOKIE_SECURE:-false} extra_hosts: - "host.docker.internal:host-gateway" volumes: - ../data:/app/data ports: - "0.0.0.0:${APP_PORT:-30327}:3100" healthcheck: test: [ "CMD", "node", "-e", "fetch('http://127.0.0.1:3100/api/health').then(r=>process.exit(r.ok?0:1)).catch(()=>process.exit(1))", ] interval: 30s timeout: 10s retries: 3 start_period: 90s networks: - internal worker: image: yubao-app:latest pull_policy: never restart: unless-stopped command: ["pnpm", "exec", "tsx", "src/worker/index.ts"] env_file: - ../.env environment: NODE_ENV: production DATABASE_URL: ${DATABASE_URL} extra_hosts: - "host.docker.internal:host-gateway" volumes: - ../data:/app/data depends_on: web: condition: service_started networks: - internal networks: internal: driver: bridge