-
Notifications
You must be signed in to change notification settings - Fork 19
/
ecosystem.config.js
51 lines (48 loc) · 1.35 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
48
49
50
51
const os = require('os');
const { PRODUCTION_HOSTNAME } = require('./dist/common/common-types');
const { PROCESS_HANDLE_CHAINS } = require('./dist/configs/bundler-config-particle');
const hostname = os.hostname();
let instances = 0;
if (process.env.ENVIRONMENT === 'production') {
if (hostname === PRODUCTION_HOSTNAME) {
instances = PROCESS_HANDLE_CHAINS.length;
} else {
instances = 0;
}
} else {
instances = PROCESS_HANDLE_CHAINS.length;;
}
let max_memory_restart = '2048M';
if (hostname === PRODUCTION_HOSTNAME) {
max_memory_restart = '7000M';
}
module.exports = {
apps: [
{
name: 'particle-bundler-server-20240930',
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',
USE_LOCAL_NODE: '1',
},
env_production: {
ENVIRONMENT: 'production',
TZ: 'UTC',
PARTICLE: '1',
USE_LOCAL_NODE: '1',
},
},
],
};