31 lines
836 B
JavaScript
31 lines
836 B
JavaScript
|
module.exports = {
|
||
|
apps: [{
|
||
|
name: 'node-app',
|
||
|
script: 'index.js',
|
||
|
instances: 1,
|
||
|
autorestart: true,
|
||
|
watch: false,
|
||
|
max_memory_restart: '256M', // Restart if app uses more than 256MB
|
||
|
kill_timeout: 3000,
|
||
|
wait_ready: true,
|
||
|
listen_timeout: 3000,
|
||
|
env: {
|
||
|
NODE_ENV: 'development',
|
||
|
PORT: 3000,
|
||
|
NODE_OPTIONS: '--max-old-space-size=200' // Limit V8 heap to 200MB
|
||
|
},
|
||
|
env_production: {
|
||
|
NODE_ENV: 'production',
|
||
|
PORT: 3000,
|
||
|
NODE_OPTIONS: '--max-old-space-size=200'
|
||
|
},
|
||
|
log_file: '/home/myuser/logs/nodejs/app.log',
|
||
|
error_file: '/home/myuser/logs/nodejs/error.log',
|
||
|
out_file: '/home/myuser/logs/nodejs/out.log',
|
||
|
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
||
|
log_type: 'json',
|
||
|
merge_logs: true,
|
||
|
max_restarts: 5,
|
||
|
min_uptime: '10s'
|
||
|
}]
|
||
|
};
|