-
Notifications
You must be signed in to change notification settings - Fork 2
/
ecosystem.config.js
41 lines (40 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
module.exports = {
apps: [{
name: 'hacker-news-analytics',
script: 'npm',
args: 'start',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '500M',
env: {
NODE_ENV: 'development',
PORT: 5000,
LEVEL: 'debug',
MONGO_URI: 'mongodb://localhost:27017/hackernews'
},
env_production: {
NODE_ENV: 'production',
PORT: 80,
LEVEL: 'debug',
MONGO_URI: 'mongodb://localhost:27017/hackernews'
}
}],
deploy: {
production: {
user: 'root',
host: 'cf',
ref: 'origin/master',
repo: 'https://github.com/christian-fei/hacker-news-analytics.git',
path: '/root/apps/hacker-news-analytics',
'pre-deploy': 'mkdir -p /root/apps/hacker-news-analytics',
'post-deploy': [
'npm install',
'(cd client && npm install && npm run build)',
'pm2 stop ecosystem.config.js',
'sleep 1',
'pm2 startOrGracefulReload ecosystem.config.js --env production'
].join(' && ')
}
}
}