Files
discord-github-ticket-relay/ecosystem.config.cjs
T
2026-10-11 13:02:20 -07:00

35 lines
1.2 KiB
JavaScript

// PM2 process file. Usage: npm run build && pm2 start ecosystem.config.cjs
// Settings are read from .env in this directory; every process shares the SQLite file.
module.exports = {
apps: [
{
// HTTP: admin console + Discord interactions endpoint. Owns PORT, so exactly one.
name: 'ticket-relay-web',
script: 'dist/index.js',
cwd: __dirname,
exec_mode: 'fork',
instances: 1,
env: { NODE_ENV: 'production', RUN_WORKER: 'false' },
kill_timeout: 10000,
// Back off instead of restarting every second when misconfigured.
exp_backoff_restart_delay: 1000,
max_memory_restart: '512M',
time: true,
},
{
// Queue workers: file issues, retry, reconcile, housekeeping. No port; scale freely.
name: 'ticket-relay-worker',
script: 'dist/worker.js',
cwd: __dirname,
exec_mode: 'fork',
instances: 2,
env: { NODE_ENV: 'production', WORKER_CONCURRENCY: '2' },
kill_timeout: 10000,
// Back off instead of restarting every second when misconfigured.
exp_backoff_restart_delay: 1000,
max_memory_restart: '256M',
time: true,
},
],
};