forked from yaelballa/sample-github-actions
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
42 lines (41 loc) · 1.02 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
42
module.exports = {
apps: [
{
name: 'myapp',
// package.json에 정의된 npm run start를 실행하게 해서 PM2로 관리하게 한다.
script: 'npm',
args: 'run dev',
instances: 2,
autorestart: true,
watch: false,
max_memory_restart: '1G',
// development mode
// pm2 start ecosystem.config.js
env: {
HOST: '0.0.0.0',
PORT: 3000,
NODE_ENV: 'development',
},
// production mode
// pm2 start ecosystem.config.js --env production
env_production: {
HOST: '0.0.0.0',
PORT: 3000,
NODE_ENV: 'production',
},
output: './logs/console.log',
error: './logs/consoleError.log',
},
],
deploy: {
production: {
// sample
user: 'node',
host: '123.12.123.1',
ref: 'origin/master',
repo: '[email protected]:repo.git',
path: '/var/www/production',
'post-deploy': 'npm install && pm2 reload ecosystem.config.js --env production',
},
},
};