/** * 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/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 error_file: '/data/logs/pm2-error.log', out_file: '/data/logs/pm2-out.log', 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, }, }, ], };