photoreport-boot.service runs infra/deploy/boot.sh at boot (starts the PM2 apps from the last built code, without depending on a saved PM2 list); tmpfiles rule for TMPDIR; deploys pm2 save; PM2 retries with exponential backoff while the database starts. Claude-Session: https://claude.ai/code/session_01HT6iXLYUUp9pJz5Kza9xCW
17 lines
612 B
JavaScript
17 lines
612 B
JavaScript
// Public sites (apps/site, Next.js): one process serves every brand domain behind the reverse proxy.
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: "photoreport-site",
|
|
cwd: __dirname + "/../../apps/site",
|
|
script: "node_modules/next/dist/bin/next",
|
|
args: "start -p 3100",
|
|
instances: 2,
|
|
exec_mode: "cluster",
|
|
// Keep retrying with a growing pause instead of giving up after 15 quick crashes (e.g. after a reboot).
|
|
exp_backoff_restart_delay: 200,
|
|
env: { NODE_ENV: "production", PORT: "3100", API_URL: process.env.API_URL || "http://127.0.0.1:3000" },
|
|
},
|
|
],
|
|
};
|