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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
allenwei
November 29, 2014
Programming
1.2k
3
Share
Build Scalable App with Docker
allenwei
November 29, 2014
More Decks by allenwei
See All by allenwei
What You Don’t Know - Remote Work
allenwei
1
150
HA Website
allenwei
1
1.7k
Other Decks in Programming
See All in Programming
ファインチューニングせずメインコンペを解く方法
pokutuna
0
250
PHPで TLSのプロトコルを実装してみるをもう一度しゃべりたい
higaki_program
0
130
AIと共にエンジニアとPMの “二刀流”を実現する
naruogram
0
120
Symfonyの特性(設計思想)を手軽に活かす特性(trait)
ickx
0
110
PHPのバージョンアップ時にも役立ったAST(2026年版)
matsuo_atsushi
0
280
AI活用のコスパを最大化する方法
ochtum
0
360
Laravel Nightwatchの裏側 - Laravel公式Observabilityツールを支える設計と実装
avosalmon
1
300
事業会社でのセキュリティ長期インターンについて
masachikaura
0
190
一度始めたらやめられない開発効率向上術 / Findy あなたのdotfilesを教えて!
k0kubun
3
2.7k
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
220
「効かない!」依存性注入(DI)を活用したAPI Platformのエラーハンドリング奮闘記
mkmk884
0
290
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
770
Featured
See All Featured
Mozcon NYC 2025: Stop Losing SEO Traffic
samtorres
0
190
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
160
BBQ
matthewcrist
89
10k
Six Lessons from altMBA
skipperchong
29
4.2k
Sam Torres - BigQuery for SEOs
techseoconnect
PRO
0
230
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
490
The Pragmatic Product Professional
lauravandoore
37
7.2k
HDC tutorial
michielstock
1
600
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
170
Exploring anti-patterns in Rails
aemeredith
3
300
DBのスキルで生き残る技術 - AI時代におけるテーブル設計の勘所
soudai
PRO
64
53k
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