dflzm
Version:
x
37 lines (36 loc) • 2.11 kB
JSON
{
"apps": {
"name": "x", // 应用名称
"script": "./bin", // 实际启动脚本
"cwd": "./", // 当前工作路径
"args": "", // 传递给脚本的参数
"interpreter": "", // 指定的脚本解释器
"interpreter_args": "", // 传递给解释器的参数
"watch": [
"bin",
"server",
"config",
"library"
], // 是否监听文件变动然后重启, true or []
"ignore_watch": [ // 不用监听的文件
"log",
"mock",
"node_modules"
],
"exec_mode": "cluster", // 应用启动模式,支持fork和cluster模式
"instances": 1, // 应用启动实例个数,仅在cluster模式有效 默认为fork,或者 max
"max_memory_restart": "1024M", // 最大内存限制数,超出自动重启
"error_file": "./log/pm2-error.log", // 错误日志文件
"out_file": "./log/pm2.log", // 正常日志文件
"merge_logs": true, // 设置追加日志而不是新建日志
"log_date_format": "YYYY-MM-DD HH:mm:ss SSS", // 指定日志文件的时间格式
"min_uptime": "60s", // 应用运行少于时间被认为是异常启动
"max_restarts": 30, // 最大异常重启次数,即小于 min_uptime 运行时间重启次数
"autorestart": true, // 默认为 true, 发生异常的情况下自动重启
// "cron_restart": "", // crontab 时间格式重启应用,目前只支持cluster模式
"restart_delay": 60,
"env": {
"NODE_ENV": "wds" // 环境参数,当前指定为生产环境
}
}
}