add environmental vars to pm2start instead of hardcoding
This commit is contained in:
@ -1,11 +1,13 @@
|
|||||||
var pm2 = require('pm2');
|
var pm2 = require('pm2');
|
||||||
pm2.connect(function() {
|
pm2.connect(function() {
|
||||||
pm2.start({
|
pm2.start({
|
||||||
name: 'server',
|
name: process.env.SERVER_NAME || 'server',
|
||||||
script: 'server/production-start.js',
|
script: 'server/production-start.js',
|
||||||
'exec_mode': 'cluster',
|
'exec_mode': 'cluster',
|
||||||
instances: '2',
|
instances: process.env.INSTANCES || 1,
|
||||||
'max_memory_restart': '900M'
|
'max_memory_restart':
|
||||||
|
(process.env.MAX_MEMORY / process.env.INSTANCES || 1) || '300M',
|
||||||
|
'NODE_ENV': 'production'
|
||||||
}, function() {
|
}, function() {
|
||||||
pm2.disconnect();
|
pm2.disconnect();
|
||||||
});
|
});
|
||||||
|
Reference in New Issue
Block a user