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 Agent Tool のためのバックエンドアーキテクチャを考える #encraft
izumin5210
6
1.8k
SourceGeneratorのススメ
htkym
0
190
0→1 フロントエンド開発 Tips🚀 #レバテックMeetup
bengo4com
0
540
IFSによる形状設計/デモシーンの魅力 @ 慶應大学SFC
gam0022
1
290
なぜSQLはAIぽく見えるのか/why does SQL look AI like
florets1
0
440
MUSUBIXとは
nahisaho
0
130
AIフル活用時代だからこそ学んでおきたい働き方の心得
shinoyu
0
130
AIによる高速開発をどう制御するか? ガードレール設置で開発速度と品質を両立させたチームの事例
tonkotsuboy_com
6
1.7k
HTTPプロトコル正しく理解していますか? 〜かわいい猫と共に学ぼう。ฅ^•ω•^ฅ ニャ〜
hekuchan
2
680
コントリビューターによるDenoのすゝめ / Deno Recommendations by a Contributor
petamoriken
0
200
Fluid Templating in TYPO3 14
s2b
0
130
公共交通オープンデータ × モバイルUX 複雑な運行情報を 『直感』に変換する技術
tinykitten
PRO
0
210
Featured
See All Featured
Avoiding the “Bad Training, Faster” Trap in the Age of AI
tmiket
0
72
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
140
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
210
So, you think you're a good person
axbom
PRO
2
1.9k
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.3k
The Illustrated Guide to Node.js - THAT Conference 2024
reverentgeek
0
250
KATA
mclloyd
PRO
34
15k
Speed Design
sergeychernyshev
33
1.5k
GraphQLの誤解/rethinking-graphql
sonatard
74
11k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
11
820
Exploring anti-patterns in Rails
aemeredith
2
250
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
17k
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