5 changed files with 41 additions and 15 deletions
@ -0,0 +1,12 @@ |
|||||
|
1: 安装pm2进程管理工具 |
||||
|
npm install pm2@latest -g |
||||
|
pm2 install pm2-logrotate |
||||
|
|
||||
|
2: 安装项目使用依赖 |
||||
|
npm install |
||||
|
|
||||
|
3: 启动方式 |
||||
|
开发环境: npm run start:dev |
||||
|
测试环境: npm run start:test |
||||
|
预发环境: npm run start:stg |
||||
|
生产环境: npm run start:prod |
@ -0,0 +1,20 @@ |
|||||
|
{ |
||||
|
"apps": [ |
||||
|
{ |
||||
|
"name": "design_node_koa", |
||||
|
"script": "app.js", |
||||
|
"log_date_format": "YYYY-MM-DD HH:mm Z", |
||||
|
"error_file": "logs/error.log", |
||||
|
"out_file": "logs/out.log", |
||||
|
"merge_logs": true, |
||||
|
"logrotate": { |
||||
|
"max_size": "10M", |
||||
|
"retain": 10, |
||||
|
"rotateInterval": "0 0 * * *", |
||||
|
"compress": true |
||||
|
}, |
||||
|
"watch": true, |
||||
|
"ignore_watch": ["node_modules", "logs"] |
||||
|
} |
||||
|
] |
||||
|
} |
Loading…
Reference in new issue