Skip to content

Instantly share code, notes, and snippets.

@memoryonrepeat
Last active December 2, 2019 09:50
Show Gist options
  • Save memoryonrepeat/f1570ff047970761eb88b91a2a2567c6 to your computer and use it in GitHub Desktop.
Save memoryonrepeat/f1570ff047970761eb88b91a2a2567c6 to your computer and use it in GitHub Desktop.
Start all services using pm2
// https://pm2.io/doc/en/runtime/reference/ecosystem-file/
const appList = [
'auction',
'auth',
'booking',
'car',
'cardata',
'contact',
'document',
'image',
'image2',
'inspection',
'order',
'salesManagement',
'search',
'payment',
'trigger'
]
const apps = appList.map(
(app) => {
const baseApp = {
name: app,
script: 'npm',
cwd: `./fcg-workspace/service/${app}/`,
args: ['start'],
autorestart: true,
watch: false, // not working - relying on nodemon
max_memory_restart: '1G',
env_production: {
NODE_ENV: 'development',
NVM_DIR: '~/.nvm'
}
}
if (app === 'auction') {
baseApp.interpreter = '[email protected]'
baseApp.args.push('--scripts-prepend-node-path=true')
}
return baseApp
}
)
module.exports = {
apps: apps
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment