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

Containers Patterns for Rails

Jairo Diaz
September 14, 2015

Containers Patterns for Rails

In this talk we explore how to use docker containers to run ruby on rails applications. Rails applications usually require several different components such as Nginx, Redis, Mongo and background jobs. We will show how to set up and manage the configuration of these elements.

Jairo Diaz

September 14, 2015
Tweet

More Decks by Jairo Diaz

Other Decks in Programming

Transcript

  1. Overview • Pets vs Cattle • Containers vs Virtual Machines

    • Running Rails on Containers ◦ Docker compose ◦ Kubernetes
  2. Pets vs Cattle • Pets are given names • They

    are unique, lovingly hand raised • When they get ill, you nurse them back to health • Cattle are given numbers • They are almost identical to other cattle • When they get ill, you get another one
  3. Docker: A happy family! Docker Go Language Linux Docker Engine

    Docker Machine Docker Compose Docker Hub
  4. Mac OS Setup for Docker rais-image Local environment Docker Machine

    (with daemon) db-image rais-app-1 rais-app-2 db ruby-image ruby-image db-image other-image Docker Hub (On the Internet) Dockerfile
  5. Rails with Kubernetes rais-image Local environment Kubernetes Minion db-image rais-app-1

    rais-app-2 db ruby-image Kubernetes Master APIs Replication Controller Scheduler etcd Kubelet Proxy Replication Controller Web Service Db Service Replication Controller CLI
  6. More information: Code examples at: http://github.com/codescrum/ Blog post on docker

    compose: http://blog.codescrum.com/ Get in touch with Jairo Diaz @codescrum