with different environments like staging and production no less! new: now with multiple account administration!
-
Create a Node.js app as you would normally, managing your dependencies with
npminpackage.json. -
Your app should be set up to listen on
process.env.STRONGLOOP_PORT || [your usual local port]. -
Download and install the Heroku toolbelt. This install includes
git.➽ If you need to handle multiple accounts, install the accounts plugin.
-
If your app is not yet in git, create a new repository. You can do this on the command line with
git init. -
Add a file called
Procfileto your project root. It should contain the following:web: node app.js, specifying the correct file to start your app. -
Add a directory called
strongloop, and create the following two files:NODE_ENV: should contain the wordproductionordevelopment. (Used for npm install.)VERSION: should contain the version of strongloop you want to install, e.g.1.1.0-1
You can use sample files from the Strongloop buildpack for Heroku and change them to your needs, if you like.
-
Create an account at Heroku as needed.
-
Log in with the toolbelt:
heroku loginor if using multiple accountsheroku accounts:set [name]. -
Create (a) Heroku app(s):
heroku create [appname] [--remote name] [--region eu] --buildpack git://github.com/ramr/strongloop-buildpack.gitYou can create multiple environments with different names and remotes e.g. a testing and a production app. By default Heroku will add a remote to your working copy called
herokuto push/deploy to.To deploy your app in a EU datacenter specify the region.
➽ For all following commands you may specify the target app with the
--app nameoption.(If you already created an app, you can use:
heroku config:set BUILDPACK_URL=git://github.com/ramr/strongloop-buildpack.git
and to add the remote to git only
git remote add heroku [your-heroku-git-url]or to update the heroku remote (-asets it locally)heroku git:remote -r name [-a name].) -
If you need to set
NODE_ENV(e.g. so that Express doesn't run in development mode) useheroku config:set NODE_ENV=production. -
Deploy your app with
git push heroku master(use the correct remote), after committing everything. Heroku will install all dependencies, including Strongloop. To deploy from a different branch use a command like this:
git push heroku develop:masterUse the correct remote name and branch names. -
Assign a dyno to your app:
heroku ps:scale web=1. -
Your app should now run. Visit it with a browser at the URI returned by the
heroku createcommand. You can troubleshoot usingheroku logs.
- https://devcenter.heroku.com/articles/nodejs
- https://github.com/ramr/strongloop-buildpack
- https://devcenter.heroku.com/articles/multiple-environments
- https://devcenter.heroku.com/articles/regions
- http://railsware.com/blog/2013/02/05/how-to-set-up-the-heroku-tools-for-deployment-with-multiple-accounts/
- Download tarball from Strongloop.
- ...
The build pack now is
https://github.com/strongloop/strongloop-buildpacks.gitcheckout http://docs.strongloop.com/display/SL/Heroku