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

Phoenix Servers with Docker

Phoenix Servers with Docker

In this presentation we define the concept of Phoenix Servers, coined by Martin Fowler, and introduce Docker as a tool to achieve this idea.

Nils De Moor

March 13, 2014
Tweet

More Decks by Nils De Moor

Other Decks in Technology

Transcript

  1. Hello! I’m Nils De Moor CTO & cofounder at WooRank

    #mongo #ansible #aws #devops #docker That’s me!
  2. CLEAN SERVER INSTALL CONFIG MGMT AGENT (CHEF, PUPPET, ANSIBLE, bash...)

    COMPOSE SCRIPTS & RUN AGENT SERVER in desired STATE Change version Edit config file Add/remove library Create folder/link/... .... Script, Configure, Run, Repeat...
  3. CLEAN SERVER INSTALL CONFIG MGMT AGENT (CHEF, PUPPET, ANSIBLE, bash...)

    COMPOSE SCRIPTS & RUN AGENT SERVER in desired STATE PUSH CODE RUN TESTs BUILD Deploy!
  4. SERVER in desired STATE SERVER in desired STATE SERVER in

    desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE Development Test Production SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STATE SERVER in desired STAT SERVER in desired STA SERVER in desired ST SERVE in desired S SERV in desired SERV in desired SER i desire SE desir S desi des de d
  5. “THE RESULT IS A UNIQUE SNOWFLAKE. GOOD FOR A SKI

    RESORT, BAD FOR A DATA CENTER.” Martin Fowler
  6. • LXC Containers • “Chroot on steroids” • AUFS •

    layered view on merged directories • copy-on-write What and how?
  7. # Dockerfile: memcached FROM ubuntu # make sure the package

    repository is up to date RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update # install memcached RUN apt-get install -y memcached # run as user daemon (memcached doesn't allow to run as root) USER daemon # expose memcached port EXPOSE 11211 # Launch memcached when launching the container # CMD [ "memcached" ] ENTRYPOINT ["memcached"]
  8. # Dockerfile: nginx and php FROM ubuntu # make sure

    the package repository is up to date RUN echo "deb http://archive.ubuntu.com/ubuntu precise main universe" > /etc/apt/sources.list RUN apt-get update # install php and nginx RUN apt-get install php5-common php5-cli php5-fpm php5-memcache php5-mcrypt nginx RUN echo "cgi.fix_pathinfo = 0;" >> /etc/php5/fpm/php.ini RUN echo "daemon off;" >> /etc/nginx/nginx.conf EXPOSE 80
  9. # Pseudo-Dockerfile: app FROM mynamespace/nginx-php MAINTAINER myself ADD . /var/www

    RUN cd /var/www && install WORKDIR /var/www EXPOSE 80 CMD [ "./start.sh" ]
  10. • Deis - deployment and orchestration • Dokku - deployment

    • Fig - deployment • Flynn - deployment and orchestration • Shipyard - monitoring Community