Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Heroku-style deploying on your own servers with Dokku

Heroku-style deploying on your own servers with Dokku

Dokku advertises itself as the "Docker powered mini-Heroku in less than 100 lines of Bash". This session will show how to get Dokku setup and ready to deploy your own applications. It covers the lifecycle of configuring, pushing and removing your apps.

Finally we'll explore the plugins that make up the Dokku ecosystem. At the end of the talk you should be able to deploy your favorite app on your private PaaS!

http://conference.phpne.org.uk/

D07a7a143b14fc8309f9abb78d569344?s=128

Alexander

March 18, 2014
Tweet

More Decks by Alexander

Other Decks in Technology

Transcript

  1. Dokku

  2. asm89 / @iam_asm89

  3. None
  4. None
  5. Shipping code

  6. None
  7. How do you feel when you're deploying?

  8. None
  9. PaaS

  10. None
  11. None
  12. None
  13. Docker powered mini-Heroku in around 100 lines of Bash.

  14. $ git push dokku master

  15. None
  16. PHP

  17. PHP Ruby Nodejs Java Scala Go Perl ...

  18. Installation

  19. None
  20. $ wget -qO- <url> | sudo DOKKU_TAG=v0.2.2 bash https://raw.github.com/progrium/dokku/v0.2.2/bootstrap.sh

  21. $ wget -qO- <url> | sudo bash https://raw.github.com/progrium/dokku/master/bootstrap.sh

  22. None
  23. *.dokku.me → <server ip>

  24. $ echo "dokku.me" > /home/dokku/VHOST

  25. $ cat ~/.ssh/id_dokku.pub \ | ssh root@dokku.me "sudo sshcommand acl-add

    dokku asm"
  26. Pushing our first app

  27. $ git init . Initialized empty Git repository in /../demo/phpne-app/.git/

  28. $ git init . Initialized empty Git repository in /../demo/phpne-app/.git/

    $ echo "<?php echo 'hello world';" > index.php
  29. $ git init . Initialized empty Git repository in /../demo/phpne-app/.git/

    $ echo "<?php echo 'hello world';" > index.php $ ll total 4.0K -rw-rw---- 1 asm users 26 Mar 18 11:26 index.php
  30. $ git init . Initialized empty Git repository in /../demo/phpne-app/.git/

    $ echo "<?php echo 'hello world';" > index.php $ ll total 4.0K -rw-rw---- 1 asm users 26 Mar 18 11:26 index.php $ git add index.php
  31. $ git init . Initialized empty Git repository in /../demo/phpne-app/.git/

    $ echo "<?php echo 'hello world';" > index.php $ ll total 4.0K -rw-rw---- 1 asm users 26 Mar 18 11:26 index.php $ git add index.php $ git commit -m "hi"
  32. $ git remote add demo dokku@dokku.me:phpne

  33. $ git remote add demo dokku@dokku.me:phpne

  34. $ git push demo master

  35. Demo

  36. https://github.com/chh/heroku-php-buildpack • Multiple PHP versions • Installs composer dependencies •

    Sets up silex/symfony2/zendframework2 app
  37. Demo

  38. CLI

  39. $ ssh dokku@dokku.me help

  40. alias dokku='ssh dokku@dokku.me'

  41. $ dokku help

  42. $ dokku config <app>

  43. $ dokku config:set <app> FOO=bar

  44. $ dokku config:get <app> FOO

  45. $ dokku config:unset <app> FOO

  46. Demo

  47. $ dokku run <app> ls

  48. $ dokku delete <app>

  49. Plugins

  50. Mongdb Rethinkdb RiakCS Neo4j Elasticsearch Mysql Mariadb Postgresql Redis Memcached

  51. Mongdb Rethinkdb RiakCS Neo4j Elasticsearch Mysql Mariadb Postgresql Redis Memcached

    https://github.com/progrium/dokku/wiki/Plugins
  52. $ cd /var/lib/dokku/plugins

  53. $ cd /var/lib/dokku/plugins $ git clone <url>

  54. $ cd /var/lib/dokku/plugins $ git clone <url> $ dokku plugins-install

  55. $ dokku help | redis

  56. Demo

  57. “about 100 lines of Bash”

  58. None
  59. progrium/gitreceive

  60. None
  61. progrium/sshcommand

  62. progrium/pluginhook

  63. Try it!

  64. #dokku @ freenode github.com/progrium/dokku

  65. flynn.io (super dokku) progrium.com/blog/ 12factor.net

  66. Happy shipping!

  67. @iam_asm89 https://joind.in/10912 http://www.flickr.com/photos/kelvin_luffs/5751337039/ http://www.flickr.com/photos/amenage/7039948463/ http://www.flickr.com/photos/pulpolux/11187139/ http://www.flickr.com/photos/marfis75/2939337382/