forked from JonathanRAZ/Claws
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecosystem.config.js
60 lines (52 loc) · 1.46 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
52
53
54
55
56
57
58
59
60
// Options reference: https://pm2.io/doc/en/runtime/reference/ecosystem-file/
const apps = [];
const apolloTvServer = {
name: 'ApolloTV Server',
script: 'server.js',
instances: process.env['PM_INSTANCES'] || 'max',
exec_mode: 'cluster',
autorestart: true,
watch: false,
max_memory_restart: process.env['PM_MAX_MEMORY_RESTART'] || '7G',
env: {
NODE_ENV: 'production'
},
env_development: {
NODE_ENV: 'development'
},
merge_logs: true
};
if (process.env.DISABLE_PM2_LOGGING === 'true') {
apolloTvServer.merge_logs = false;
apolloTvServer.disable_logs = true;
apolloTvServer.out_file = '/dev/null';
apolloTvServer.error_file = '/dev/null';
}
apps.push(apolloTvServer);
if (process.env.RATE_LIMITER === 'true') {
const rateLimiter = {
name: 'Rate Limiter',
script: './rate-limiter.js',
instances: 1,
autorestart: true,
watch: false,
max_memory_restart: process.env['PM_RL_MAX_MEMORY_RESTART'] || '200M',
env: {
NODE_ENV: 'production'
},
env_development: {
NODE_ENV: 'development'
},
merge_logs: true
};
if (process.env.DISABLE_PM2_LOGGING === 'true') {
rateLimiter.merge_logs = false;
rateLimiter.disable_logs = true;
rateLimiter.out_file = '/dev/null';
rateLimiter.error_file = '/dev/null';
}
apps.push(rateLimiter);
}
module.exports = {
apps
};