Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Build Scalable App with Docker
Search
allenwei
November 29, 2014
Programming
3
1.2k
Build Scalable App with Docker
allenwei
November 29, 2014
Tweet
Share
More Decks by allenwei
See All by allenwei
What You Don’t Know - Remote Work
allenwei
1
140
HA Website
allenwei
1
1.7k
Other Decks in Programming
See All in Programming
AI巻き込み型コードレビューのススメ
nealle
2
2.5k
LangChain4jとは一味違うLangChain4j-CDI
kazumura
1
140
手戻りゼロ? Spec Driven Developmentとは@KAG AI week
tmhirai
1
140
CSC307 Lecture 14
javiergs
PRO
0
450
日本だけで解禁されているアプリ起動の方法
ryunakayama
0
360
今更考える「単一責任原則」 / Thinking about the Single Responsibility Principle
tooppoo
3
1.3k
JPUG勉強会 OSSデータベースの内部構造を理解しよう
oga5
2
220
PJのドキュメントを全部Git管理にしたら、一番喜んだのはAIだった
nanaism
0
230
Oxlint JS plugins
kazupon
1
1.2k
PostgreSQL を使った快適な go test 環境を求めて
otakakot
0
390
Claude Codeセッション現状確認 2026福岡 / fukuoka-aicoding-00-beacon
monochromegane
3
380
API Platformを活用したPHPによる本格的なWeb API開発 / api-platform-book-intro
ttskch
1
120
Featured
See All Featured
brightonSEO & MeasureFest 2025 - Christian Goodrich - Winning strategies for Black Friday CRO & PPC
cargoodrich
3
110
Mind Mapping
helmedeiros
PRO
1
110
Chasing Engaging Ingredients in Design
codingconduct
0
130
VelocityConf: Rendering Performance Case Studies
addyosmani
333
24k
Docker and Python
trallard
47
3.8k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
Being A Developer After 40
akosma
91
590k
Music & Morning Musume
bryan
47
7.1k
Measuring Dark Social's Impact On Conversion and Attribution
stephenakadiri
1
140
Building Flexible Design Systems
yeseniaperezcruz
330
40k
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
970
How to Ace a Technical Interview
jacobian
281
24k
Transcript
Build Scalable App with Docker Allen Wei
[email protected]
allenwei.cn
About Me • Manager of Groupon Payments China • Ruby
developer • iOS developer • DevOps • twitter: @allenwei • weibo: @魏伦
Docker
Docker
The Twelve Factor App • Setup automation • Portability •
Easy to deploy • Continuous deployment • Scale up easily http://12factor.net/ Adam Wiggins
Disposability Maximize robustness with fast startup and graceful shutdown
Process Execute the app as one or more stateless processes
Backing Services Treat backing services as attached resources
Port binding Export services via port binding
Concurrency Scale out via the process model
Build, release, run Strictly separate build and run stages
Config Store config in the environment
More • Keep development, staging, and production as similar as
possible • Treat logs as event streams • Run admin/management tasks as one-off processes
Problem • Container Management • Service Discovery • Health Check
• Configuration Management
Shipyard
Shipyard
Shipyard
Shipyard
Fig http://fig.sh
Fig
Fig
Fig • fig build • fig up • fig start/stop
• fig scale
Consul https://consul.io/
Service Discovery Consul API DNS
Consul API
Container Register • progrium/registrator • Listen to docker socket •
Register when container started • Unregister when container stop • Register with meta data
Docker Registrator
Docker Registrator
Consul API
Consul API
Consul API
DNS Query
DNS RoundRobin
DNS Lookup
Failure Detection Health Check - Node Health Check - Service
Heath Check
Multi Datacenter Multi DataCenter Agent DataCenter Lookup
Key/Value Storage K/V Database Configuration Management
Key Value Store
Get value Recursively
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
Demo
Container Management
Cluster Management
Docker in Groupon 2015 Q1
One more thing
A Minimal Operating System Docker Containers Painless Updating Clustered By
Default
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/
Q & A thanks