Files
jerapah-flow/ecosystem.config.cjs
T
nsrbandCursor f9f21052d9 chore: trim distribution clutter and add lint/test tooling
Keep only example workflows in default/, move site-specific YAMLs to gitignored local/, remove the duplicate get-current-time plugin install, document personal plugins, clarify PM2 ecosystem usage, add shared Vitest and web ESLint, and extract OpsStatusCard for ops cards.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-08-22 06:30:37 +07:00

48 lines
1.1 KiB
JavaScript

/**
* Production PM2 ecosystem (monolith runner).
* Use for deployed/single-process starts. For local multi-process Ops UI, use
* `pnpm dev:pm2` → packages/server/ecosystem.dev.cjs / control.js instead.
*/
const fs = require("fs");
const path = require("path");
function loadEnv(file) {
const out = {};
if (!fs.existsSync(file)) return out;
for (const line of fs.readFileSync(file, "utf8").split("\n")) {
const t = line.trim();
if (!t || t.startsWith("#")) continue;
const i = t.indexOf("=");
if (i === -1) continue;
const key = t.slice(0, i).trim();
let val = t.slice(i + 1).trim();
if (
(val.startsWith('"') && val.endsWith('"')) ||
(val.startsWith("'") && val.endsWith("'"))
) {
val = val.slice(1, -1);
}
out[key] = val;
}
return out;
}
const root = __dirname;
module.exports = {
apps: [
{
name: "jerapah-flow",
cwd: root,
script: "packages/server/runner.js",
interpreter: "node",
instances: 1,
autorestart: true,
max_restarts: 20,
env: {
NODE_ENV: "production",
...loadEnv(path.join(root, ".env")),
},
},
],
};