forked from crusher-dev/crusher
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecosystem.config.sample.js
70 lines (68 loc) · 2.04 KB
/
ecosystem.config.sample.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
61
62
63
64
65
66
67
68
69
70
// 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: IS_PRODUCTION ? 'node' : "npm",
args: IS_PRODUCTION ? 'server.js' : 'run dev',
env: CRUSHER_APP_ENV,
merge_logs: true,
},
{
name: 'crusher-server',
cwd: './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'npm',
args: IS_PRODUCTION ? '-r source-map-support/register app.js' : 'run dev',
watch: ['src', 'config'],
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
name: 'crusher-server-cron',
cwd: './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'npm',
args: IS_PRODUCTION ? 'cron.js' : 'run dev:cron',
watch: ['src', 'config'],
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
merge_logs: true,
name: 'crusher-server-queue',
cwd: './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'npm',
args: IS_PRODUCTION ? '-r source-map-support/register queue.js' : 'run dev:queue',
watch: ['src', 'config'],
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: IS_PRODUCTION ? 'node' : 'npm',
args: IS_PRODUCTION ? 'index.js' : 'run start',
env: VIDEO_PROCESSOR_ENV,
},
{
name: 'local-storage',
cwd: './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'npm',
args: IS_PRODUCTION ? '-r source-map-support/register storage.js' : 'run dev:storage',
watch: ['src', 'config'],
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
],
};