Clojure compojure app in Heroku

Tried out today the clojure compojure app deployment into cloud service. Deployment didn’t went as smoothly as one might have expected:

  1. By default it wanted to use Java6 instead of Java7.
  2. App didn’t start.
  3. It wanted to use older (< 2.0) Leiningen by default.
  4. App was oddly named in the heroku’s end,  and resulted non-descriptive domain url.

These all were easy to fix:

  1. Add a new file into your project’s root:
     echo "java.runtime.version=1.7" >
  2. Add a new file into your project’s root:
     echo "web: lein ring server-headless $PORT" > Procfile
  3. Add into project.clj file:
    :min-lein-version "2.0.0"
  4. You can simply rename the app through the heroku dashboard  and app’s settings pane, with rename functionality. Note that the heroku git repository name also changes, so you have to manually change it into your local project’s ./git/config-file so you can continue pushing into production.