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.
 
 
 
 
 

50 lines
1.1 KiB

// PM2 配置文件
module.exports = {
apps: [
{
name: 'just-demo-backend',
script: './backend/dist/app.js',
cwd: './',
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: './logs/backend-error.log',
out_file: './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
},
{
name: 'just-demo-frontend',
script: 'serve',
cwd: './frontend',
args: 'dist -p 5500 -s',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '200M',
env: {
NODE_ENV: 'production'
},
error_file: './logs/frontend-error.log',
out_file: './logs/frontend-out.log',
log_date_format: 'YYYY-MM-DD HH:mm:ss Z',
merge_logs: true
}
]
};