forked from EcoEnvAI/DEXiWare
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.js
More file actions
82 lines (80 loc) · 2.38 KB
/
Copy pathecosystem.config.js
File metadata and controls
82 lines (80 loc) · 2.38 KB
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
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
module.exports = {
apps : [{
name: 'dexiware-backend',
append_env_to_name: true,
script: 'backend/app.js',
// Options reference: https://pm2.keymetrics.io/docs/usage/application-declaration/
args: 'one two',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
time: true,
env_production: {
NODE_ENV: 'production',
'PORT': '5000',
'DB_NAME': 'truedb'
},
env_staging: {
NODE_ENV: 'staging',
'PORT': '5001',
'DB_NAME': 'truedb_staging'
}
},
{
name: 'dexiware-frontend',
append_env_to_name: true,
script: 'serve',
args: '',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: '1G',
env: {
PM2_SERVE_PATH: './frontend/dist/true/',
PM2_SERVE_PORT: 4200,
PM2_SERVE_SPA: 'true',
PM2_SERVE_HOMEPAGE: '/index.html'
},
env_production: {
PM2_SERVE_PATH: './frontend/dist/true/browser',
PM2_SERVE_PORT: 4200,
PM2_SERVE_SPA: 'true',
PM2_SERVE_HOMEPAGE: '/index.html'
},
env_staging: {
PM2_SERVE_PATH: './frontend/dist/true/browser',
PM2_SERVE_PORT: 4201,
PM2_SERVE_SPA: 'true',
PM2_SERVE_HOMEPAGE: '/index.html'
}
}],
deploy : {
production : {
user : 'true',
host : 'pathfinder.ijs.si',
ref : 'origin/true',
repo : 'git@repo.ijs.si:environmental/true-interface.git',
path : '/srv/true/production',
"pre-setup": 'npm install -g pm2 && npm install -g @angular/cli',
"post-deploy" : 'cd backend && npm install && cd ../frontend && npm install && npm run build -- --configuration=production --base-href=/true/ && cd .. && pm2 startOrRestart ecosystem.config.js --env production',
env : {
'NODE_ENV': 'production',
'PORT': '5000'
}
},
staging: {
user : 'true',
host : 'pathfinder.ijs.si',
ref : 'origin/true',
repo : 'git@repo.ijs.si:environmental/true-interface.git',
path : '/srv/true/staging',
"pre-setup": 'npm install -g pm2 && npm install -g @angular/cli',
"post-deploy" : 'cd backend && npm install && cd ../frontend && npm install && npm run build -- --configuration=staging --base-href=/true/stag/ && cd .. && pm2 startOrRestart ecosystem.config.js --env staging',
env : {
'NODE_ENV': 'staging',
'PORT': '5001'
}
}
}
};