source: Klonkt/ecosystem.config.cjs@ df7de6e

main
Last change on this file since df7de6e was d2b7247, checked in by Robin Genis <roboburr@…>, 2 months ago

chore(branding): stale product names in comments + deploy templates -> Klonkt

Cosmetic only — comments (CSS/EJS/SQL/ecosystem.config.cjs headers) and the deploy/ doc
templates: old names (PrutCMS/PrutFolio) -> Klonkt, stale Prutter (removed DM feature) mentions
dropped, deploy/ Dutch comments translated to English. No code, identifiers, rendered strings,
package name, PWA id, real infra paths, or roboburr refs touched.

  • Property mode set to 100644
File size: 1.5 KB
Line 
1/**
2 * PM2 ecosystem config — production process manager.
3 *
4 * Single fork (NOT cluster mode) because:
5 * - SqliteSessionStore is in-process: cluster workers wouldn't share sessions.
6 * - better-sqlite3 is synchronous and not designed for multi-process writes.
7 * If you ever need horizontal scaling, swap the session store for a shared
8 * backend (Redis) first, then enable cluster mode.
9 *
10 * Usage:
11 * pm2 start ecosystem.config.cjs --env production
12 * pm2 save && pm2 startup # auto-start on boot
13 * pm2 logs klonkt
14 */
15
16module.exports = {
17 apps: [
18 {
19 name: 'klonkt',
20 script: 'src/server.js',
21 cwd: __dirname,
22 exec_mode: 'fork',
23 instances: 1,
24 autorestart: true,
25 watch: false, // never watch in prod
26 max_memory_restart: '512M', // restart if RSS exceeds this
27 kill_timeout: 5000, // give in-flight requests time to finish
28
29 // Logs go to ~/.pm2/logs/klonkt-out.log and -error.log by default.
30 // Override here if you want them in the project dir:
31 // out_file: './logs/out.log',
32 // error_file: './logs/error.log',
33 merge_logs: true,
34 time: true, // prefix log lines with timestamps
35
36 env: {
37 NODE_ENV: 'development',
38 PORT: 3000,
39 },
40 env_production: {
41 NODE_ENV: 'production',
42 PORT: 3000,
43 // SESSION_SECRET, AUDIO_SECRET etc. should come from .env on the server,
44 // dotenv loads them automatically. Don't bake them into this file.
45 },
46 },
47 ],
48};
Note: See TracBrowser for help on using the repository browser.