Files
harats-booking/ecosystem.config.cjs

50 lines
998 B
JavaScript

/**
* PM2 Ecosystem Config — Harat's Booking
*
* Docker: pm2-runtime ecosystem.config.cjs
* Local: pm2 start ecosystem.config.cjs --env development
*/
module.exports = {
apps: [
{
name: 'harats-server',
cwd: __dirname,
script: 'dist/src/index.js',
instances: 1,
exec_mode: 'fork',
// Auto-restart
autorestart: true,
max_restarts: 10,
min_uptime: '10s',
restart_delay: 2000,
max_memory_restart: '512M',
// Logs (stdout/stderr for Docker)
error_file: '/dev/stderr',
out_file: '/dev/stdout',
merge_logs: true,
time: true,
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
// Graceful shutdown
kill_timeout: 5000,
listen_timeout: 8000,
shutdown_with_message: true,
watch: false,
env: {
NODE_ENV: 'production',
PORT: 3001,
},
env_development: {
NODE_ENV: 'development',
PORT: 3001,
},
},
],
};