-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathecosystem.config.js
More file actions
35 lines (32 loc) · 954 Bytes
/
ecosystem.config.js
File metadata and controls
35 lines (32 loc) · 954 Bytes
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
const fs = require('fs');
const path = require('path');
const dotenv = require('dotenv');
const filePath = path.resolve(__dirname, '..', '.env');
let env = {};
try {
env = dotenv.parse(fs.readFileSync(filePath));
} catch (e) {
console.log(
"If you're setting the env vars in the shell, it should be fine (you can probably ignore the error)."
);
console.log(e);
}
// without this, loopback cannot find strong-error-handler. Node can, so we know
// there's no _real_ issue, but loopback is not able to find it.
const loopbackModuleResolutionHack = path.resolve(
__dirname,
'../node_modules/.pnpm/node_modules'
);
module.exports = {
apps: [
{
script: `./lib/production-start.js`,
cwd: __dirname,
env: { ...env, NODE_PATH: loopbackModuleResolutionHack },
max_memory_restart: '600M',
instances: 'max',
exec_mode: 'cluster',
name: env.DEPLOYMENT_ENV === 'staging' ? 'dev' : 'org'
}
]
};