-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecosystem.config.js
39 lines (39 loc) · 1.32 KB
/
ecosystem.config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/**
* @description pm2 configuration file.
* @example
* production mode :: pm2 start ecosystem.config.js --only prod
* development mode :: pm2 start ecosystem.config.js --only dev
*/
module.exports = {
apps: [
{
name: 'prod', // pm2 start App name
script: 'dist/server.js',
exec_mode: 'cluster', // 'cluster' or 'fork'
instance_var: 'INSTANCE_ID', // instance variable
instances: 1, // pm2 instance count
autorestart: true, // auto restart if process crash
watch: false, // files change automatic restart
ignore_watch: ['node_modules', 'logs'], // ignore files change
max_memory_restart: '1G', // restart if process use more than 1G memory
merge_logs: true, // if true, stdout and stderr will be merged and sent to pm2 log
output: './logs/access.log', // pm2 log file
error: './logs/error.log', // pm2 error log file
env: {
// environment variable
PORT: 3000,
NODE_ENV: 'prod',
},
},
],
// deploy: {
// production: {
// user: 'user',
// host: '0.0.0.0',
// ref: 'origin/master',
// repo: '[email protected]:repo.git',
// path: 'dist/server.js',
// 'post-deploy': 'npm install && npm run build && pm2 reload ecosystem.config.js --only prod',
// },
// },
};