development
js 82 lines 2.29 KB
Raw
1 /**
2 * PM2 Ecosystem Configuration for smbCloud Web - Production
3 *
4 * Isolated environment configuration for multi-tenant deployment.
5 *
6 * Private secrets do not belong in this file.
7 * Replace placeholder values on the server copy if you need them, then run:
8 * pm2 restart smbcloud-web --update-env && pm2 save
9 *
10 * Usage:
11 * mkdir -p /home/git/apps/web/smbcloudweb/logs
12 * cd /home/git/apps/web/smbcloudweb
13 * pm2 start ecosystem.config.js --env production
14 * pm2 restart smbcloud-web
15 * pm2 reload smbcloud-web --update-env
16 * pm2 stop smbcloud-web
17 * pm2 logs smbcloud-web
18 * pm2 monit
19 */
20
21 module.exports = {
22 apps: [
23 {
24 name: "smbcloud-web",
25
26 // This app runs from the standalone server entrypoint.
27 script: "node",
28 args: "server.js",
29
30 cwd: "/home/git/apps/web/smbcloudweb",
31
32 instances: 1,
33 exec_mode: "fork",
34
35 autorestart: true,
36 watch: false,
37 max_memory_restart: "1G",
38
39 min_uptime: "10s",
40 max_restarts: 10,
41 restart_delay: 4000,
42
43 error_file: "/home/git/apps/web/smbcloudweb/logs/pm2-error.log",
44 out_file: "/home/git/apps/web/smbcloudweb/logs/pm2-out.log",
45 log_file: "/home/git/apps/web/smbcloudweb/logs/pm2-combined.log",
46 time: true,
47 log_date_format: "YYYY-MM-DD HH:mm:ss Z",
48 merge_logs: true,
49
50 env_production: {
51 NODE_ENV: "production",
52 // The standalone server reads PORT and HOSTNAME from env.
53 PORT: "3030",
54 HOSTNAME: "127.0.0.1",
55
56 NEXT_TELEMETRY_DISABLED: "1",
57 APP_NAME: "smbcloud-web",
58 APP_ID: "smbcloud-web-prod",
59
60 // Optional reference placeholders. Replace or remove on the server copy.
61 BASE_PATH: "",
62 NEXT_UMAMI_ID: "__SET_ON_SERVER_IF_ENABLED__",
63 NEXT_PUBLIC_GISCUS_REPO: "__SET_ON_SERVER_IF_ENABLED__",
64 NEXT_PUBLIC_GISCUS_REPOSITORY_ID: "__SET_ON_SERVER_IF_ENABLED__",
65 NEXT_PUBLIC_GISCUS_CATEGORY: "__SET_ON_SERVER_IF_ENABLED__",
66 NEXT_PUBLIC_GISCUS_CATEGORY_ID: "__SET_ON_SERVER_IF_ENABLED__",
67 },
68
69 node_args: [
70 "--max-old-space-size=2048",
71 "--max-http-header-size=16384",
72 ].join(" "),
73
74 kill_timeout: 5000,
75 wait_ready: false,
76 listen_timeout: 10000,
77 shutdown_with_message: false,
78
79 vizion: false,
80 },
81 ],
82 };