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