Files
photoreport/infra/pm2/site.config.cjs
spark daf7fa7c11
ci / rust (push) Successful in 9m14s
ci / typescript (push) Successful in 11m18s
Come back by itself after a reboot: boot unit for api and site, TMPDIR at boot, PM2 retries
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
2026-10-13 10:32:56 +01:00

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" },
},
],
};