// PM2 部署配置 —— 联动支付 CRM // 启动:pm2 start ecosystem.config.js // 说明:-H 0.0.0.0 让服务监听所有网卡(外部可访问),而非仅 localhost。 // DATABASE_URL / AUTH_SECRET / AUTH_URL 由项目根目录 .env 提供(Next 自动加载)。 module.exports = { apps: [ { name: "liandong-crm", // 直接调用 next 可执行文件,参数里绑定 0.0.0.0 script: "node_modules/next/dist/bin/next", args: "start -H 0.0.0.0 -p 3100", cwd: __dirname, instances: 1, exec_mode: "fork", autorestart: true, watch: false, max_memory_restart: "512M", env: { NODE_ENV: "production", // 如需覆盖也可在此设 PORT/HOSTNAME: // HOSTNAME: "0.0.0.0", // PORT: "3100", }, error_file: "logs/err.log", out_file: "logs/out.log", merge_logs: true, time: true, }, ], };