更新PM2配置并添加相关脚本
This commit is contained in:
@@ -2,12 +2,13 @@ module.exports = {
|
||||
apps: [{
|
||||
name: 'jiebanke-backend',
|
||||
script: './src/server.js',
|
||||
instances: 'max',
|
||||
exec_mode: 'cluster',
|
||||
instances: 1,
|
||||
exec_mode: 'fork',
|
||||
// 环境变量
|
||||
env: {
|
||||
NODE_ENV: 'development',
|
||||
PORT: 3200,
|
||||
WATCH: true
|
||||
WATCH: false
|
||||
},
|
||||
env_production: {
|
||||
NODE_ENV: 'production',
|
||||
@@ -20,14 +21,17 @@ module.exports = {
|
||||
WATCH: false
|
||||
},
|
||||
// 日志配置
|
||||
log_file: '/data/nodejs/jiebanke/logs/combined.log',
|
||||
out_file: '/data/nodejs/jiebanke/logs/out.log',
|
||||
error_file: '/data/nodejs/jiebanke/logs/error.log',
|
||||
log_file: './logs/combined.log',
|
||||
out_file: './logs/out.log',
|
||||
error_file: './logs/error.log',
|
||||
log_date_format: 'YYYY-MM-DD HH:mm:ss',
|
||||
// 性能配置
|
||||
max_memory_restart: '1G',
|
||||
kill_timeout: 3000,
|
||||
wait_ready: true,
|
||||
listen_timeout: 3000,
|
||||
// 重启策略
|
||||
autorestart: true,
|
||||
max_restarts: 10,
|
||||
restart_delay: 4000,
|
||||
// 监控配置
|
||||
watch: false,
|
||||
ignore_watch: [
|
||||
@@ -35,10 +39,6 @@ module.exports = {
|
||||
'logs',
|
||||
'.git',
|
||||
'uploads'
|
||||
],
|
||||
// 重启策略
|
||||
autorestart: true,
|
||||
max_restarts: 10,
|
||||
restart_delay: 4000
|
||||
]
|
||||
}]
|
||||
};
|
||||
Reference in New Issue
Block a user