You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
35 lines
845 B
35 lines
845 B
// PM2 配置文件
|
|
const path = require('path');
|
|
|
|
module.exports = {
|
|
apps: [
|
|
{
|
|
name: 'just-demo-backend',
|
|
script: path.resolve(__dirname, 'backend/dist/app.js'),
|
|
cwd: path.resolve(__dirname),
|
|
instances: 1,
|
|
autorestart: true,
|
|
watch: false,
|
|
max_memory_restart: '500M',
|
|
env: {
|
|
NODE_ENV: 'production',
|
|
PORT: 3000
|
|
},
|
|
env_production: {
|
|
NODE_ENV: 'production',
|
|
PORT: 3000
|
|
},
|
|
error_file: path.resolve(__dirname, 'logs/backend-error.log'),
|
|
out_file: path.resolve(__dirname, 'logs/backend-out.log'),
|
|
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
|
|
merge_logs: true,
|
|
// 自动重启策略
|
|
min_uptime: '10s',
|
|
max_restarts: 10,
|
|
// 启动延迟
|
|
listen_timeout: 3000,
|
|
kill_timeout: 5000
|
|
}
|
|
]
|
|
};
|
|
|
|
|