AND WHY? 
WHAT I S A N 
OCTOHOST?
WHAT? 
• A micro-Heroku inspired PaaS. 
• A way to deploy (mostly) web code easily and reliably. 
• `git push` to running site
WHY? 
• Heroku is awesome but pretty expensive. 
• Dependency management for websites everything is 
super annoying. 
• Needed an automated way to host lots of small sites. 
• At the start of the project, wanted to learn about Docker. 
• Wanted to deploy small web tools here without setting 
up a new box for each. (And dependencies, oh my.)
RVM ON THE SERVER IS NOT THE ANSWER 
WHY NOT RVM?
DON’T EVEN HAVE 1.9.X OR 2.1.X 
THIS IS WASTEFUL
THIS IS BETTER
I T ’ S 
• A more efficient use of resources. Costs less. 
• No version and language dependency hell. 
• Much more flexible. 
• More control than alternate PaaS services. 
• Much easier than using Docker manually.
HOW DOES 
IT WORK?
QUICK TERMINOLOGY 
• Docker: Open source container virtualization platform. 
• Image: A read only non-running container. 
• Container: A running image or series of images. Each 
container can be running a different OS or series of 
dependancies and doesn’t interfere with any other. 
• Registry: A Docker image storage service.
DOCKER USES IMAGES 
AS LAYERS
PIECES 
• Lots of bash glue. 
• End result is a running 
Docker container. 
• Thin wrapper around 
Docker with utility `octo` 
command.
THE KEY 
DOCKERFILE
WHAT? 
• FROM - what container to 
start with. 
• ADD - put my git repo in 
/srv/www 
• EXPOSE - open this port 
to the outside. 
• CMD - run this as the 
foreground process
YOU MIGHT BE ASKING 
WHAT ABOUT PYTHON?
SO MANY QUESTIONS 
BUT WHAT 
IS “FROM”?
DOCKER USES LAYERS
MAKE YOUR OWN - MIX AND MATCH 
HERE’S PYTHON 2.7
DEMO TIME 
ENOUGH 
TALK
DEMO TIME 
WHAT DOES 
`OCTO` DO?
OTHER 
ITEMS
ALL CONFIG SHOULD USE 
ENVIRONMENT VARIABLES 
• 12 Factor App Pattern: http://12factor.net/config 
• `octo config:set {container}/{KEY} “{VALUE}”` 
• `octo config {container}` - show all values 
• Makes it easier to move the container around. 
• An example: https://github.com/datadog/preston
CNAME 
• Special file in the root of a 
repo. 
• Add arbitrary domain 
names to the container. 
• Add one on each line. 
• You still need to update 
the external DNS, but this 
takes care of nginx config.
CAVEAT 
EMPTOR
YOUR DATA IS EPHEMERAL 
——— More than that.
SINGLE PROCESS 
IT RUNS QUITE WELL 
BUT 
KEEP 
AN 
EYE 
ON 
I T
BUT IS THE BEST DEFAULT 
THIS MAY CHANGE
THANKS 
QUESTIONS?

What is octohost?

  • 1.
    AND WHY? WHATI S A N OCTOHOST?
  • 2.
    WHAT? • Amicro-Heroku inspired PaaS. • A way to deploy (mostly) web code easily and reliably. • `git push` to running site
  • 3.
    WHY? • Herokuis awesome but pretty expensive. • Dependency management for websites everything is super annoying. • Needed an automated way to host lots of small sites. • At the start of the project, wanted to learn about Docker. • Wanted to deploy small web tools here without setting up a new box for each. (And dependencies, oh my.)
  • 4.
    RVM ON THESERVER IS NOT THE ANSWER WHY NOT RVM?
  • 5.
    DON’T EVEN HAVE1.9.X OR 2.1.X THIS IS WASTEFUL
  • 6.
  • 8.
    I T ’S • A more efficient use of resources. Costs less. • No version and language dependency hell. • Much more flexible. • More control than alternate PaaS services. • Much easier than using Docker manually.
  • 9.
  • 10.
    QUICK TERMINOLOGY •Docker: Open source container virtualization platform. • Image: A read only non-running container. • Container: A running image or series of images. Each container can be running a different OS or series of dependancies and doesn’t interfere with any other. • Registry: A Docker image storage service.
  • 11.
  • 12.
    PIECES • Lotsof bash glue. • End result is a running Docker container. • Thin wrapper around Docker with utility `octo` command.
  • 13.
  • 14.
    WHAT? • FROM- what container to start with. • ADD - put my git repo in /srv/www • EXPOSE - open this port to the outside. • CMD - run this as the foreground process
  • 17.
    YOU MIGHT BEASKING WHAT ABOUT PYTHON?
  • 19.
    SO MANY QUESTIONS BUT WHAT IS “FROM”?
  • 20.
  • 21.
    MAKE YOUR OWN- MIX AND MATCH HERE’S PYTHON 2.7
  • 22.
  • 23.
    DEMO TIME WHATDOES `OCTO` DO?
  • 24.
  • 25.
    ALL CONFIG SHOULDUSE ENVIRONMENT VARIABLES • 12 Factor App Pattern: http://12factor.net/config • `octo config:set {container}/{KEY} “{VALUE}”` • `octo config {container}` - show all values • Makes it easier to move the container around. • An example: https://github.com/datadog/preston
  • 26.
    CNAME • Specialfile in the root of a repo. • Add arbitrary domain names to the container. • Add one on each line. • You still need to update the external DNS, but this takes care of nginx config.
  • 27.
  • 28.
    YOUR DATA ISEPHEMERAL ——— More than that.
  • 29.
    SINGLE PROCESS ITRUNS QUITE WELL BUT KEEP AN EYE ON I T
  • 31.
    BUT IS THEBEST DEFAULT THIS MAY CHANGE
  • 32.