-
Notifications
You must be signed in to change notification settings - Fork 14
/
ecosystem.config.js
47 lines (44 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
42
43
44
45
46
47
const os = require('os');
const hostname = os.hostname();
let instances = 0;
if (process.env.ENVIRONMENT === 'production') {
if (hostname === 'particle-bundler-server-handler') {
instances = 1;
} else {
instances = 0;
}
} else {
instances = 2;
}
let max_memory_restart = '2048M';
if (hostname === 'particle-bundler-server-handler') {
max_memory_restart = '7000M';
}
module.exports = {
apps: [
{
name: 'particle-bundler-server',
script: './dist/main.js',
time: true,
instances,
kill_timeout: 15000,
exec_mode: 'cluster',
max_memory_restart,
env_development: {
ENVIRONMENT: 'dev',
TZ: 'UTC',
PARTICLE: '1',
},
env_debug: {
ENVIRONMENT: 'debug',
TZ: 'UTC',
PARTICLE: '1',
},
env_production: {
ENVIRONMENT: 'production',
TZ: 'UTC',
PARTICLE: '1',
},
},
],
};