The plan with that blog post, which is more of a step-by-step thing where I won't explain a lot of things, but do it, is to have a VM with Dokku installed where you can push your app built with one of the supported language (by default: Ruby, Node.js, Java, Play!, Python, PHP, Clojure, Go, Dart) and run it with a PostgreSQL 9.1 server in it's own Docker container. I'll assume Rails for a few Rails specific steps, but you can skip those if you are not a Rails person.

What are Dokku and Docker?

I started to play with Dokku and Docker a few days ago. I heard about it before, but playing with it is just enlightening. Same for Dokku. Those are awesome pieces of software. Docker is a MAJOR game changer. What is it? Here is the official description:

"Docker is an open-source project to easily create lightweight, portable, self-sufficient containers from any application. The same container that a developer builds and tests on a laptop can run at scale, in production, on VMs, bare metal, OpenStack clusters, public clouds and more."

Roughly, Docker is built to have sandboxed containers running on your servers or local development VMs.

What about Dokku? "Docker powered mini-Heroku in less than 100 lines of Bash".

Ok, let's do it!

WARNING: this is not production proof at all, you would want to do a few things differently and add a bunch more stuff, mostly security and backup wise. Also, this won't scale horizontally at all. I did that for fun, not for production!

Some manual setup for PostgreSQL (first, please change the placeholders for real values and also remove square brackets). There might be command line equivalents for those, if so, please feel free to share in the comments.

Set hostname by editing /home/git/VHOST. Set it to the root domain you will use. In my case, it could be 'jipiboily.com'. The app would be created under that domain (ie: app.jipiboily.com). For more information on that one: https://github.com/progrium/dokku/#configuring.

On your local machine, in your project's directory (it must be a git repo. Also, change the placeholders and remove square brackets):

Re-push (yeah, you apparently need to do that for now so that env vars will be used next time. It might work without re-pushing if you were quick enough to create the ENV file BEFORE the end of the initial git push).

For Rails projects, to run migrations, for now, it seems a bit of a pain. Here is how I do it, but I will look at a better solution at some point for sure:

Backups (not robust or production ready AT ALL)
The steps will include a S3 client, create a basic script and then a cron job. Nothing production ready, but if you want to play with something you still want to have backups for, here is how you could do it. Really, really simple and NOT production proof AT ALL. Understood? ;)

apt-get install s3cmd -y
s3cmd --configure

Follow the steps (giving access and secret keys)

touch ~/pg-backup.sh
chmod +x ~/pg-backup.sh
vi ~/pg-backup.sh

Content of the pg-backup.sh file (please change the project directory on line 3 and S3 bucket name on last line):