Here is a non-comprehensive list of Node/Sails hosting providers and available community tutorials.
To deploy to OpenShift, you'll need to make some minor modifications to your configuration:
Open up config/local.js
in your app folder. In here, you'll need to add the following lines.
port: process.env.OPENSHIFT_NODEJS_PORT,
host: process.env.OPENSHIFT_NODEJS_IP,
You will also need to install grunt-cli
with npm i --save grunt-cli
.
After doing that, create the file .openshift/action_hooks/pre_start_nodejs
with the following contents. (source)
This action_hook tells OpenShift's supervisor to run all 'prod' grunt tasks, before Sails lifted.
#!/bin/bash
export NODE_ENV=production
if [ -f "${OPENSHIFT_REPO_DIR}"/Gruntfile.js ]; then
(cd "${OPENSHIFT_REPO_DIR}"; node_modules/grunt-cli/bin/grunt prod)
fi
Then disable Sails Grunt integration hook.
To do this set the grunt
property to false
in .sailsrc
hooks like this:
{
"hooks": {
"grunt": false
}
}
Do not remove Gruntfile.js to disable Grunt hook, this file still using by OpenShift's supervisor.
Then create the file /supervisor_opts
with the following contents. This tells OpenShift's supervisor to ignore Sails' .tmp
directory for the hot reload functionality. (source)
-i .tmp
This deployment guide works only on Openshift's "SCALABLE" gears, nodejs v0.10.
If you're using non-scalable gear, the /supervisor_opts
file will be ignored and Sails will not lift on it.
You can now git add . && git commit -a -m "your message" && git push
to deploy to OpenShift.
- Platzi: Develop Apps with Sails.js: Pt 2 (see part 2)
- SailsCasts: Deploying a Sails App to Heroku
- Sails.js on Heroku
- https://groups.google.com/forum/#!topic/sailsjs/vgqJFr7maSY
- https://github.com/chadn/heroku-sails
- http://dennisrongo.com/deploying-sails-js-to-heroku
- http://stackoverflow.com/a/20184907/486547
- https://www.digitalocean.com/community/articles/how-to-create-an-node-js-app-using-sails-js-on-an-ubuntu-vps
- https://www.digitalocean.com/community/articles/how-to-use-pm2-to-setup-a-node-js-production-environment-on-an-ubuntu-vps
- https://www.digitalocean.com/community/articles/how-to-host-multiple-node-js-applications-on-a-single-vps-with-nginx-forever-and-crontab
- http://blog.grio.com/2014/01/your-own-mini-heroku-on-aws.html
- http://serverfault.com/questions/531560/creating-an-sails-js-application-on-aws-ami-instance
- http://bussing-dharaharsh.blogspot.com/2013/08/creating-sailsjs-application-on-aws-ami.html
- http://cloud.dzone.com/articles/how-deploy-nodejs-apps-aws-mac
- Getting Started: A Simple Sails.js App
- Quickstart: nanobox-sails
- Official Sails.js Guides
- Official Nanobox Docs
- Join Us on Slack for Help
- Install Sails.js with Apache as a reverse proxy on CentOS 7
- Install Sails.js on Ubuntu
- All hosting plans from RoseHosting are fully-managed with free 24/7 support, so you can contact their support team and they will install and configure Sails.js for you for free
The instructions and setup are pretty much the same with Linode as they are with Vultr, DigitalOcean and other cloud server providers.