Last active
December 2, 2019 09:50
-
-
Save memoryonrepeat/f1570ff047970761eb88b91a2a2567c6 to your computer and use it in GitHub Desktop.
Start all services using pm2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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