# 邮件预报 — 宝塔宿主机 MySQL + Docker 应用(无容器 MySQL) # 服务器示例:192.168.2.14 代码目录:/home/project/yubao 对外端口:30327 # # 用法(在项目根目录 /home/project/yubao): # cp deploy/.env.bt-host-mysql.example .env # 若根目录尚无 .env # bash deploy/install-bt-host-mysql.sh name: yx-bt services: web: build: context: .. dockerfile: Dockerfile image: yubao-app:latest restart: unless-stopped command: ["sh", "/app/scripts/docker-entrypoint-web.sh"] env_file: - ../.env environment: NODE_ENV: production DATABASE_URL: ${DATABASE_URL} SEED_ON_START: ${SEED_ON_START:-true} 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 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