pm2 ecosystem configuration

This commit is contained in:
Oliver Bryan
2025-12-31 04:33:37 +00:00
parent f534bc6dec
commit 4b38c1115a

39
ecosystem.config.cjs Normal file
View File

@@ -0,0 +1,39 @@
const path = require("node:path");
const backendPort = Number(process.env.BACKEND_PORT || 3000);
const frontendPort = Number(process.env.FRONTEND_PORT || 1420);
module.exports = {
apps: [
{
name: "issue-backend",
cwd: path.join(__dirname, "packages", "backend"),
script: "bun",
args: `src/index.ts --PORT=${backendPort}`,
interpreter: "none",
exec_mode: "fork",
instances: 1,
autorestart: true,
watch: false,
restart_delay: 2000,
max_restarts: 10,
kill_timeout: 5000,
time: true,
},
{
name: "issue-frontend",
cwd: path.join(__dirname, "packages", "frontend"),
script: "bun",
args: `run preview -- --host 0.0.0.0 --port ${frontendPort}`,
interpreter: "none",
exec_mode: "fork",
instances: 1,
autorestart: true,
watch: false,
restart_delay: 2000,
max_restarts: 10,
kill_timeout: 5000,
time: true,
},
],
};