running node.js sails app on openshift

421 views Asked by At

I'm trying to deploy my node.js sails app on openshift. I followed procedure outlined in https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6 but still doesn't work. also try this: Node.js app on openshift

no matter what i'm getting "Service Temporarily Unavailable" The server is temporarily unable to service your request due to maintenance downtime or capacity problems. Please try again later. Error.

Hopefully someone can at least point me to the right direction. Thanks in advance.

1

There are 1 answers

1
Thomas Lee On BEST ANSWER

I have also deployed my application onto openshift and here are my steps

  1. Create a node.js Cartridges 0.10

  2. In the repo, please mention "https://github.com/ryanj/nodejs-custom-version-openshift" since my sails need npm version 1.4.0 and the original one is 1.3.X

  3. git clone the repo

  4. copy your file into that repo

  5. Follow this page https://gist.github.com/mdunisch/4a56bdf972c2f708ccc6 The first two steps should be done if you haven't changed the original stuff. The only things is to change ".openshift/action_hooks/pre_start_nodejs" and append that at the end to make it is as a production and run the grunt

  6. git add . and git push

  7. It will automatically build and at the end will tell you deployment completed with status: success

I am also new but hope you can try. Thanks

One more things, if missing the step 5, you won't run the sails and can't see the log in the terminal and result in 503 on browser.

But I have another question after each push on openshift, you can see my log if you want to know what is the right status Why mongodb is reset after push to openshift

Another suggestion is to ssh and make sure the npm -v is larger than 1.4.0, try to npm install -g npm to update the version.

If still fails, i will suggest to npm install sails -g and try to commit and look for the build..