// PYRE / Prometheus Protocol — PM2 ecosystem (process manager) config // // ⚠️ INERT / NOT YET RUNNABLE: the apps are NOT implemented yet. This file // defines how the three PYRE processes WILL run once apps/web, apps/api, // and apps/worker are built/deployed. Starting it now will fail because // the apps (and their builds) do not exist yet. // // Process names match docs/PYRE_MVP_DESIGN.md §12: pyre-web, pyre-api, pyre-worker. // // Once apps exist, start with: // pm2 start ecosystem.config.cjs // pm2 save # persist process list so `pm2 resurrect` works on boot // // PM2 is installed at user level: ~/.local/share/pnpm/bin/pm2 // Logs go to /home/pyre/pyre/logs/ (rotated by infra/logrotate/pyre). // // Note on memory: the 8GB VPS is shared with postgres, redis, nginx, etc., // so each process is capped at 400M via max_memory_restart. module.exports = { apps: [ { // Next.js frontend (production) — port 3000 per .env.example (WEB_PORT). name: "pyre-web", cwd: "apps/web", script: "pnpm", args: "start", // runs `next start` (requires a prior `pnpm build`) instances: 1, autorestart: true, max_memory_restart: "400M", env: { NODE_ENV: "production", PORT: 3000, }, out_file: "/home/pyre/pyre/logs/pyre-web-out.log", error_file: "/home/pyre/pyre/logs/pyre-web-err.log", }, { // Fastify HTTP API — port 4000 per .env.example (API_PORT). // Runs the compiled server. Until a build exists you can temporarily // swap to a dev runner: script: "pnpm", args: "dev" name: "pyre-api", cwd: "apps/api", script: "node", args: "dist/index.js", instances: 1, autorestart: true, max_memory_restart: "400M", env: { NODE_ENV: "production", PORT: 4000, }, out_file: "/home/pyre/pyre/logs/pyre-api-out.log", error_file: "/home/pyre/pyre/logs/pyre-api-err.log", }, { // BullMQ background worker (no HTTP port). // Runs the compiled worker. Until a build exists you can temporarily // swap to a dev runner: script: "pnpm", args: "dev" name: "pyre-worker", cwd: "apps/worker", script: "node", args: "dist/index.js", instances: 1, autorestart: true, max_memory_restart: "400M", env: { NODE_ENV: "production", }, out_file: "/home/pyre/pyre/logs/pyre-worker-out.log", error_file: "/home/pyre/pyre/logs/pyre-worker-err.log", }, ], };