modernzombie modernzombie - 4 months ago 37x
Node.js Question

Deploying Sails.js On Openshift

When I deploy a Sails.js app to OpenShift it restarts over and over again.

So basically I am having the exact same problem with the same output from

rhc tail
described in this question and this answer describes why this error is occurring but there are no solutions offered

Has anyone successfully deployed a Sails.js app to OpenShift?

I am committed to the OpenShift platform at this point but really want to use SailsJS for my next app.

Thanks for any suggestions.


In order to start Sails on OpenShift, you need to set the port and host config keys in your /config/local.js to:

port: process.env.OPENSHIFT_NODEJS_PORT || 8080,
host: process.env.OPENSHIFT_NODEJS_IP

The question / answer you referred to is valid; the supervisor instance on OpenShift does seem to have a problem with Grunt. The quick solution is to start your app once to get the .tmp directory built, then stop it and move your Gruntfile.js elsewhere. Then you can start your app with ctl_app start and it should do fine. You might also killall node before you start the app, just to make sure previous attempts aren't still going.