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

Build Scalable App with Docker

allenwei
November 29, 2014

Build Scalable App with Docker

allenwei

November 29, 2014
Tweet

More Decks by allenwei

Other Decks in Programming

Transcript

  1. About Me • Manager of Groupon Payments China • Ruby

    developer • iOS developer • DevOps • twitter: @allenwei • weibo: @魏伦
  2. The Twelve Factor App • Setup automation • Portability •

    Easy to deploy • Continuous deployment • Scale up easily http://12factor.net/ Adam Wiggins
  3. More • Keep development, staging, and production as similar as

    possible • Treat logs as event streams • Run admin/management tasks as one-off processes
  4. Fig

  5. Fig

  6. Container Register • progrium/registrator • Listen to docker socket •

    Register when container started • Unregister when container stop • Register with meta data
  7. Use ENV as configuration • Language- and OS-agnostic standard •

    More difficult to accidentally commit to a code repo • Environmental variables are easy to change between environments
  8. Reference • https://hashicorp.com/blog/introducing-consul-template.html • https://github.com/hashicorp/consul-template • https://github.com/progrium/registrator • http://progrium.com/blog/2014/08/20/consul-service-discovery-with-docker/ •

    http://progrium.com/blog/2014/07/29/understanding-modern-service- discovery-with-docker/ • https://tech.bellycard.com/blog/load-balancing-docker-containers-with-nginx- and-consul-template/ • http://12factor.net/