2

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.

zabumba
  • 12,172
  • 16
  • 72
  • 129
modernzombie
  • 1,987
  • 7
  • 25
  • 44

1 Answers1

5

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.

sgress454
  • 24,870
  • 4
  • 74
  • 92
  • Thanks Scott! I had the port part right but not the host. I will give your other suggestions a try also and let you know how they work out. – modernzombie Mar 20 '14 at 17:50
  • 1
    @Scott I ask this in the name of @cartoonle: `Isn't local.js for local environment only, how could that change something on OpenShift? Where should i move gruntfile.js to? May i delete it? Rename it?`. Thanks in advance – Balder Apr 01 '14 at 11:32
  • 1
    @Balder the sails.js documentation says "this is where you include configuration overrides for your local system or for a production deployment." referring to local.js - for Gruntfile.js I just renamed it before deploying and changed it back when developing my application. – modernzombie Apr 01 '14 at 12:03
  • @modernzombie But its included in .gitignore – Rockstar5645 Dec 30 '15 at 13:48