forked from TerriaJS/terriajs-server
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ecosystem.config.js
37 lines (29 loc) · 1.05 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
/*global __dirname*/
const path = require('path');
// This is a PM2 "ecosystem file", intended for a development environment.
// For documentation on options, see https://pm2.io/doc/en/runtime/reference/ecosystem-file/
// Pass through additional arguments that might ultimately have come from
// something like `npm run start -- --port 3009`
const argpos = process.argv.indexOf('--');
const args = argpos > -1 ? process.argv.slice(argpos + 1) : [];
module.exports = {
apps : [{
name: path.basename(__dirname),
script: 'lib/app.js',
// passed to app, so any valid arguments in options.js are allowed.
args: args.join(' '),
// Increase the number of instances to support more concurrent users.
instances: 1,
autorestart: true,
// rather than setting watch:true here, use `npm run watch`
watch: false,
max_memory_restart: '1G',
env: {
NODE_ENV: 'development'
},
// If the script is called with `--env production`, this environment variable gets set.
env_production: {
NODE_ENV: 'production'
}
}]
};