Linux, Python, devops, etc
19 September 2013
Dokku is a small project put together in a few lines of Bash script, to set up a git-push based PaaS a la Heroku. It relies on Docker to do a lot of the heavy lifting, but it's quite an interesting little project, because it's almost exactly like a project I had all planned out, except someone else has already built it and it works.
Set up is simple. On a server running Ubuntu 13.04 x64, run the following command:
wget -qO- https://raw.github.com/progrium/dokku/master/bootstrap.sh | sudo bash
Make sure you have a domain name and a wildcard pointed at your server (For the purposes of demonstrating, let's say, **.sekretcloud.jste.com.au), and make sure to put the domain name into /home/git/VHOST so Dokku knows what it is.
root@sekretcloud# echo sekretcloud.jste.com.au > /home/git/VHOST
And then upload your SSH key:
jste@local$ cat ~/.ssh/id_rsa.pub | ssh email@example.com "sudo gitreceive upload-key jste"
Deploying an application is then relatively trivial:
jste@local$ git remote add sekretcloud firstname.lastname@example.org:fancyapp jste@local$ git push sekretcloud master
Since this is our first push, this will bootstrap the application on your Dokku server. Subsequent pushes will redeploy. You can now reach your site at http://fancyapp.sekretcloud.jste.com.au
Dokku handles deployments by using heroku buildpacks, and has a number of options built in - Python, node.js, Ruby, PHP, and Go are some of the buildpacks already supported, and the plugin system has examples of setting up postgres and mariadb databases. In all, it is a fantastic little project I plan to make use of in the near future.
Oh, and the brain behind it is working on a bigger project with a similar concept that will probably be worth keeping an eye on: Flynn.io