48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
/**
|
|
* PM2 ecosystem for ReLoop v2
|
|
*
|
|
* Usage (on Dev VM after build):
|
|
* pm2 start ecosystem.config.js
|
|
* pm2 save
|
|
* pm2 reload ecosystem.config.js # zero-downtime restart
|
|
*/
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: 'reloop-api',
|
|
cwd: './backend',
|
|
script: 'dist/main.js',
|
|
instances: 1,
|
|
exec_mode: 'fork',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: '3011',
|
|
},
|
|
max_memory_restart: '512M',
|
|
error_file: './logs/reloop-api.error.log',
|
|
out_file: './logs/reloop-api.out.log',
|
|
merge_logs: true,
|
|
time: true,
|
|
},
|
|
{
|
|
name: 'reloop-web',
|
|
cwd: './frontend',
|
|
// Next.js standalone server (requires `output: 'standalone'` in next.config.js
|
|
// and manual copy of `.next/static` and `public` into `.next/standalone` after build).
|
|
script: '.next/standalone/server.js',
|
|
instances: 1,
|
|
exec_mode: 'fork',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: '3010',
|
|
HOSTNAME: '0.0.0.0',
|
|
},
|
|
max_memory_restart: '512M',
|
|
error_file: './logs/reloop-web.error.log',
|
|
out_file: './logs/reloop-web.out.log',
|
|
merge_logs: true,
|
|
time: true,
|
|
},
|
|
],
|
|
};
|