forked from crusher-dev/crusher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecosystem.config.prod.js
50 lines (48 loc) · 1.21 KB
/
ecosystem.config.prod.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
// This is used by pm2
// Centralize this config file
const { CRUSHER_APP_ENV, CRUSHER_SERVER_ENV, TEST_RUNNER_ENV, VIDEO_PROCESSOR_ENV, CRUSHER_EXTENSION_ENV } = require('./ecosystem/env');
const { IS_PRODUCTION } = require('./ecosystem/config');
console.log(`Starting pm2 for ${IS_PRODUCTION ? 'production' : 'development'}`);
module.exports = {
apps: [
{
name: 'crusher-app',
cwd: './packages/crusher-app',
script: 'npm',
args: 'start',
env: CRUSHER_APP_ENV,
merge_logs: true,
},
{
name: 'crusher-server',
cwd: './packages/crusher-server',
script: 'node',
args: '-r source-map-support/register app.js',
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
name: 'crusher-server-queue',
cwd: './packages/crusher-server',
script: 'node',
args: 'queue.js',
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
name: 'test-runner',
cwd: './packages/test-runner',
script: IS_PRODUCTION ? 'node' : 'npm',
args: IS_PRODUCTION ? 'index.js' : 'run start',
watch: ['src', 'config', 'util'],
env: TEST_RUNNER_ENV,
},
{
name: 'video-processor',
cwd: './packages/video-processor',
script: 'npm',
args: 'run start',
env: VIDEO_PROCESSOR_ENV,
},
],
};