Files
liandong-crm/ecosystem.config.js
T
luishouandClaude Opus 4.8 1e8396d0d3 chore: 部署改为 PM2,服务监听 0.0.0.0
- 新增 ecosystem.config.js(next start -H 0.0.0.0 -p 3100)
- package.json start 脚本绑定 0.0.0.0
- DEPLOY.md 重写为 PM2 详细部署,含端口放行/防火墙/Nginx 反代/更新回滚
- .gitignore 忽略 logs/

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 19:43:10 +08:00

31 lines
944 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 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,
},
],
};