-
Notifications
You must be signed in to change notification settings - Fork 13
/
ecosystem.config.js
41 lines (41 loc) · 1.09 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
40
41
module.exports = {
apps: [
{
name: '<app-name>',
script: 'dist/src/index.js',
// Options reference: https://pm2.keymetrics.io/docs/usage/application-declaration/
exec_mode: 'cluster',
instances: 2,
kill_timeout: 5000,
autorestart: true,
max_restarts: 10,
watch: true,
watch_options: {
followSymlinks: false,
},
max_memory_restart: '1G',
env: {
NODE_ENV: 'development',
},
env_production: {
NODE_ENV: 'production',
port: 8080,
},
merge_logs: true,
log_date_format: 'YYYY-MM-DDTHH:mm:ss.sssZ',
},
],
// https://pm2.keymetrics.io/docs/usage/deployment/
deploy: {
production: {
key: process.env.EC2_PEM_PATH,
host: process.env.EC2_HOST,
user: 'ubuntu',
ref: 'origin/main',
repo: '[email protected]:<username>/<repo-name>.git',
path: '/home/ubuntu',
'post-deploy':
'yarn && yarn clean && yarn build && pm2 startOrRestart ecosystem.config.js --env production && pm2 set pm2:autodump true && pm2 save',
},
},
};