forked from GoodDollar/GoodBootstrap
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathecosystem.config.js
69 lines (66 loc) · 1.61 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
61
62
63
64
65
66
67
68
69
const dotenv = require("dotenv");
const fs = require("fs");
module.exports = {
apps: [
{
name: "good-blockchain",
script: "npm",
args: "run start:blockchain",
env: {
...readEnv("packages/contracts/.env.dev"),
...readEnv("packages/contracts/.env")
},
merge_logs: true,
out_file: "logs/blockchain.out.log",
error_file: "logs/blockchain.err.log",
pid_file: "logs/blockchain.pid"
},
{
name: "good-server",
script: "npm",
args: "run start:server",
env: {
...readEnv("packages/server/.env.dev"),
...readEnv("packages/server/.env")
},
merge_logs: true,
out_file: "logs/server.out.log",
error_file: "logs/server.err.log",
pid_file: "logs/server.pid"
},
{
name: "good-dapp",
script: "npm",
args: "run start:dapp",
env: {
...readEnv("packages/dapp/.env.dev"),
...readEnv("packages/dapp/.env")
},
merge_logs: true,
out_file: "logs/dapp.out.log",
error_file: "logs/dapp.err.log",
pid_file: "logs/dapp.pid"
},
{
name: "good-gun",
script: "npm",
args: "run start:gun",
env: {
...readEnv("packages/gun/.env.dev"),
...readEnv("packages/gun/.env")
},
merge_logs: true,
out_file: "logs/gun.out.log",
error_file: "logs/gun.err.log",
pid_file: "logs/gun.pid"
}
]
};
function readEnv(path, options) {
try {
return dotenv.parse(fs.readFileSync(path), options);
} catch (e) {
// console.error(`Couldn't read '${path}' file`)
}
return {};
}