[okfn-labs] Heroku as a deployment platform for OKFN apps?

Tom Oinn tom.oinn at okfn.org
Sun Aug 5 13:59:20 UTC 2012


We've been using Heroku to deploy Textus instances with quite a lot of
success, chatting with Nick Stenning a while ago we pretty much agreed
that this would be a good way to go in general for most OKFN
applications, anyone else have experience / opinions on this?

Obviously not going to be so good for really big projects, but for
something like Textus where we can go from nothing to a fully deployed
app with its own elasticsearch instance in about five minutes it's
rather cool. This is all using the no-cost service level (for both
Heroku and the various addons we use), I suspect it gets expensive
very quickly if you really need more capacity but the agility is great
and being able to give people the ability to create their own versions
of Textus that easily similarly so.

For reference the steps required to get a Textus instance running are
as follows - you won't actually get much working at this exact moment
in time as I'm re-skinning the entire site and a few things are broken
but...

Firstly you need to install the heroku tools
(https://toolbelt.heroku.com/) and git for your machine, create an
account on Heroku and give it your credit card (it won't be charged,
but even though we use the free tier of the addons the system won't
let you install them without billing information). Then do:

==========================================================
$ git clone git://github.com/okfn/textus.git
        Cloning into 'textus'...
        remote: Counting objects: 962, done.
        remote: Compressing objects: 100% (547/547), done.
        Receiving objects: 100% (962/962), 652.19 KiB | 232 KiB/s, done.
        Resolving deltas: 100% (542/542), done.
$ cd textus
$ heroku login
        Enter your Heroku credentials.
        Email: tom.oinn at okfn.org
        Password (typing will be hidden):
        Authentication successful.
$ heroku create
        Creating aqueous-cliffs-5696... done, stack is cedar
        http://aqueous-cliffs-5696.herokuapp.com/ |
git at heroku.com:aqueous-cliffs-5696.git
        Git remote heroku added
$ heroku rename mytextus
        Renaming aqueous-cliffs-5696 to mytextus... done
        http://mytextus.herokuapp.com/ | git at heroku.com:mytextus.git
        Git remote heroku updated
$ heroku addons:add bonsai
        Adding bonsai on mytextus... done, v2 (free)
        Use `heroku addons:docs bonsai` to view documentation.
$ heroku addons:add mailgun:starter
        Adding mailgun:starter on mytextus... done, v3 (free)
        Use `heroku addons:docs mailgun:starter` to view documentation.
$ git push heroku master
        Counting objects: 962, done.
        Delta compression using up to 8 threads.
        Compressing objects: 100% (891/891), done.
        Writing objects: 100% (962/962), 639.94 KiB | 45 KiB/s, done.
        Total 962 (delta 541), reused 79 (delta 45)
        -----> Heroku receiving push
        -----> Node.js app detected
        -----> Resolving engine versions
                   Using Node.js version: 0.6.20
                   Using npm version: 1.1.41
        -----> Fetching Node.js binaries
        -----> Vendoring node into slug
        -----> Installing dependencies with npm
                   npm http GET https://registry.npmjs.org/express
                   npm http GET https://registry.npmjs.org/elastical
                        ......
                   Dependencies installed
        -----> Discovering process types
                   Procfile declares types -> web
        -----> Compiled slug size is 4.7MB
        -----> Launching... done, v5
                   http://mytextus.herokuapp.com deployed to Heroku
        To git at heroku.com:mytextus.git
         * [new branch]      master -> master
==========================================================

If anyone has any horror stories I'd love to hear them, thus far it's
been pretty much entirely painless.

-- 
Tom Oinn
+44 (0) 20 8123 5142 or Skype ID 'tomoinn'
http://www.crypticsquid.com




More information about the okfn-labs mailing list