-
-
Notifications
You must be signed in to change notification settings - Fork 38
/
ecosystem.config.sample.js
70 lines (67 loc) Β· 2.33 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 } = require('./ecosystem/env');
const { IS_PRODUCTION } = require('./ecosystem/config');
console.log(`Starting pm2 for ${IS_PRODUCTION ? 'production' : 'development'}`);
const USE_OUTPUTS_DIR = process.env.USE_OUTPUTS_DIR;
console.log(USE_OUTPUTS_DIR);
module.exports = {
apps: [
{
name: 'crusher-app',
cwd: USE_OUTPUTS_DIR ? './output/crusher-app/' : './packages/crusher-app',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? 'server.js' : 'run dev',
env: CRUSHER_APP_ENV,
merge_logs: true,
},
{
name: 'crusher-server',
cwd: USE_OUTPUTS_DIR ? './output/crusher-server' : './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? '-r source-map-support/register app.js' : 'run dev',
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
name: 'crusher-server-cron',
cwd: USE_OUTPUTS_DIR ? './output/crusher-server' : './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? 'cron.js' : 'run dev:cron',
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
merge_logs: true,
name: 'crusher-server-queue',
cwd: USE_OUTPUTS_DIR ? './output/crusher-server' : './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? '-r source-map-support/register queue.js' : 'run dev:queue',
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
{
name: 'test-runner',
cwd: USE_OUTPUTS_DIR ? './output/test-runner' : './packages/test-runner',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? 'index.js' : 'run start',
watch: ['src', 'config', 'util'],
env: TEST_RUNNER_ENV,
},
{
name: 'video-processor',
cwd: USE_OUTPUTS_DIR ? './output/video-processor' : './packages/video-processor',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? 'index.js' : 'run start',
env: VIDEO_PROCESSOR_ENV,
},
{
name: 'local-storage',
cwd: USE_OUTPUTS_DIR ? './output/crusher-server' : './packages/crusher-server',
script: IS_PRODUCTION ? 'node' : 'pnpm',
args: IS_PRODUCTION ? '-r source-map-support/register storage.js' : 'run dev:storage',
watch: ['src', 'config'],
env: CRUSHER_SERVER_ENV,
merge_logs: true,
},
],
};