make production future ready

This commit does the following:

Production start should use the following command `npm run
start-producion` this first runs bower install and builds the front end
app(react). Then it will use the `pm2Start` script. This script will set
up the pm2 daemons to run loopback in cluster mode. This script also use
`production-start` script instead of the regular `server` script.

The reasons are two fold: to ensure `server` is run in es7 mode, and to
wait for handshake from DB or kill itself if no DB can be found within a
certain amount of time.
This commit is contained in:
Berkeley Martinez
2015-07-24 22:22:40 -07:00
parent 00b81f408b
commit c0eda90eb1
5 changed files with 45 additions and 38 deletions

View File

@ -2,7 +2,7 @@ var pm2 = require('pm2');
pm2.connect(function() {
pm2.start({
name: 'server',
script: 'server/server.js',
script: 'server/production-start.js',
'exec_mode': 'cluster',
instances: '2',
'max_memory_restart': '900M'