59 lines
1.5 KiB
JavaScript
59 lines
1.5 KiB
JavaScript
module.exports = {
|
|
apps: [{
|
|
name: 'digitalHuman-callbackTask-v3',
|
|
script: './index.js',
|
|
cwd: './',
|
|
args: '',
|
|
interpreter: 'node',
|
|
interpreter_args: '',
|
|
|
|
// 监听文件修改
|
|
watch: true,
|
|
ignore_watch: ['config', 'logs', 'node_modules', 'redis', 'school', 'static', 'worker_threads',
|
|
'.env', 'package.json', 'package-lock.json', 'pnpm-lock.yaml', 'webSocket.js',
|
|
'outside/outPlatforms', 'outside/generat.js', 'outside/polling.js', 'outside/record.js',
|
|
'pm2Index.config.cjs','pm2Websocket.config.cjs'],
|
|
|
|
// 实例数
|
|
instances: 1,
|
|
exec_mode: 'fork',
|
|
|
|
// 自动重启设置
|
|
autorestart: true,
|
|
max_restarts: 30,
|
|
min_uptime: '10s',
|
|
|
|
// 内存限制重启
|
|
// max_memory_restart: '1G',
|
|
|
|
// 日志配置
|
|
out_file: './logs/index/out/out.log',
|
|
error_file: './logs/index/error/error.log',
|
|
// log_file: './logs/combined.log',
|
|
log_type: 'raw', // 或 'json'
|
|
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
|
logrotate: {
|
|
max_size: '5M', // 日志文件最大大小
|
|
retain: 30, // 保留最近7天的日志
|
|
compress: true, // 压缩旧日志
|
|
date_format: 'YYYY-MM-DD' // 日期格式
|
|
},
|
|
|
|
// 合并日志
|
|
// combine_logs: true,
|
|
|
|
// 监控和重启设置
|
|
kill_timeout: 1600,
|
|
restart_delay: 4000,
|
|
|
|
// 环境变量
|
|
// env: {
|
|
// NODE_ENV: 'development',
|
|
// PORT: 8080
|
|
// },
|
|
env_production: {
|
|
NODE_ENV: 'production',
|
|
PORT: 8080
|
|
}
|
|
}],
|
|
}; |