What is Docker?
It’s a way to put your linux applications into their own containers on the same machine or across a network. It’s not the same thing as a VM. It’s far more efficient and your friends will be envious of your dev ops skills.
What is Dokku?
It’s a poor man’s Heroku written in about 100 lines of BASH. You can run it yourself on a $5 digital ocean instance. Unlike Heroku, you have more control over things. After all, it’s your machine. Want to run a background worker? Need an extra cron job? No problem.
- “Push to deploy” simplicity that automatically detects the kind of app you are working on.
- Supports tons of “buildpacks” or plugins that auto configure your app based on the framework you are using. Rails support is fantastic.
- It has an awesome ecosystem of ‘host it yourself’ plugins and modules for things like Postgres, MongoDB, Redis, RabbitMQ and all that other stuff the cool kids use.
- Setup a domain.
Make an A record that points to the digital ocean IP.
220.127.116.11in my case.
- Image your Digital Ocean box to use Dokku. It requires Ubuntu and DigitalOcean has a Dokku image you can use by default.
- Visit the URL of your DigitalOcean machine. Paste your SSH public key into the text box found on the server. MAC USERS: Use this to load it in clipboard:
pbcopy < ~/.ssh/id_rsa.pub.
- Select “Use Virtual Naming for Apps”. If you are frugal and want to run all of your apps off of one box. You will want 1GB of RAM minimum- trust me. Name your default app something like 00default to forgo the need to subdomain your default app.
git remote add dokku dokku@DOMAIN_NAME_HERE:APP_NAME_HERE**inside your app’s git repo
git push dokku master
docker ps: Shows running processes and their status.
docker kill <container ID>: I’ll give you three guesses
dokku config:set <app> NAME=valueor
dokku config:get : Lets you set ENV['SECRETS']in your app. Useful for open source apps that run in the wild.
docker logs: Because sometimes production breaks.
dokku help: A quick overview of all the commands you will ever need (~10).