haixunMaster/ecosystem.config.cjs

53 lines
1.0 KiB
JavaScript
Raw Permalink Normal View History

2026-06-21 12:50:31 +00:00
const path = require("path");
const root = __dirname;
/** @type {import('pm2').StartOptions[]} */
const apps = [
{
name: "haixun-web",
script: path.join(root, "scripts/pm2-web.sh"),
interpreter: "bash",
cwd: root,
instances: 1,
exec_mode: "fork",
autorestart: true,
max_restarts: 10,
min_uptime: "10s",
env: {
NODE_ENV: "production",
PORT: 3000,
},
},
{
name: "haixun-worker",
script: path.join(root, "scripts/pm2-worker.sh"),
interpreter: "bash",
cwd: root,
instances: 1,
exec_mode: "fork",
autorestart: true,
max_restarts: 10,
min_uptime: "10s",
env: {
NODE_ENV: "production",
},
},
{
name: "haixun-web-dev",
script: path.join(root, "scripts/pm2-web-dev.sh"),
interpreter: "bash",
cwd: root,
instances: 1,
exec_mode: "fork",
autorestart: true,
max_restarts: 10,
min_uptime: "10s",
env: {
NODE_ENV: "development",
PORT: 3000,
},
},
];
module.exports = { apps };