41 lines
1.3 KiB
JavaScript
41 lines
1.3 KiB
JavaScript
// PM2 process definitions for the Plesk Linux VPS.
|
|
// pm2 start ecosystem.config.js # start both
|
|
// pm2 reload ecosystem.config.js # zero-downtime redeploy
|
|
// pm2 save && pm2 startup # resurrect both on reboot
|
|
//
|
|
// Run PM2 independently of Plesk's Node/Passenger extension. nginx (managed by Plesk)
|
|
// reverse-proxies the domain to the `web` process on PORT.
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: "podcastyes-web",
|
|
// Next.js standalone server emitted by `next build` (output: "standalone").
|
|
script: ".next/standalone/server.js",
|
|
cwd: __dirname,
|
|
instances: 1,
|
|
exec_mode: "fork",
|
|
// Load runtime secrets from .env (Node 20+). Keeps secrets out of this file.
|
|
node_args: "--env-file=.env",
|
|
env: {
|
|
NODE_ENV: "production",
|
|
PORT: 3000,
|
|
HOSTNAME: "127.0.0.1",
|
|
},
|
|
max_memory_restart: "512M",
|
|
},
|
|
{
|
|
name: "podcastyes-worker",
|
|
// Long-running pg-boss consumer; shells out to ffmpeg for audio stitching.
|
|
script: "node_modules/.bin/tsx",
|
|
args: "worker/index.ts",
|
|
cwd: __dirname,
|
|
instances: 1,
|
|
exec_mode: "fork",
|
|
env: {
|
|
NODE_ENV: "production",
|
|
},
|
|
max_memory_restart: "768M",
|
|
},
|
|
],
|
|
};
|