Skip to content
Patrik Fredriksson edited this page Feb 1, 2014 · 8 revisions

Heroku

Deployment instructions for Heroku (WiP)

Heroku allows 750 h of free "dyno hours" per month, so you can use that to test this deployment free of charge. See Heroku Usage & Billing for further info.

Prerequisites

Heroku doesn't offer MongoDB support, but it is available from a third party as an "Add-on", we will use the service from MongoHQ here. MongoHQ offer a free sandbox version of their service, in order to use this service you need to supply credit card information to Heroku by verifying your account, see Account Verification for further details.

Deploy!

Deploy the application to Heroku!

The Heroku way to deploy application is by pushing source code using Git to Heroku and then to let Heroku build and deploy the application. Heroku does in fact have support for building Clojure code using Leiningen, so that works just fine.

The deployment requires a Procfile containing running instructions. This file is supplied among the project files in the GitHub repository:

web: lein with-profile production trampoline run -m notes.handler $PORT

To deploy our application on Heroku, do the following:

  1. cd into the clone of the Notes! Git repository
  2. Login to Heroku, and upload your SSH-key: heroku login (a key will be generated if you don't have one). If you use an old Heroku account the SSH-key will not be automatically added, use heroku keys:add to upload a new key.
  3. Create the application (this will also create the Heroku Git remote): heroku create.
  4. Add the MongoHQ add-on (note, this requires a verified Heroku account, see above): heroku addons:add mongohq:sandbox
  5. Push: git push heroku master

BOOM! And you're done!

You can now access the Notes! application, you'll find the URL by doing heroku apps:info.

Destroy the app when you are done: heroku apps:destroy --app <app-name>.

Clone this wiki locally