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
Docker ApplicationをDaaSにデプロイ #dockerjp
Search
taichi nakashima
April 11, 2014
Technology
11
6.4k
Docker ApplicationをDaaSにデプロイ #dockerjp
at Docker meetup Tokyo #2
taichi nakashima
April 11, 2014
Tweet
Share
More Decks by taichi nakashima
See All by taichi nakashima
Platform Engineering at Mercari (Platform Engineering Kaigi 2024)
tcnksm
5
3.5k
Platform Engineering at Mercari
tcnksm
8
4.8k
Embedded SRE at Mercari
tcnksm
0
1.4k
How We Harden Platform Security at Mercari
tcnksm
2
1.7k
SRE Practices in Mercari Microservices
tcnksm
11
12k
開発者向けの基盤をつくる
tcnksm
38
12k
How We Structure Our Work At Mercari Microservices Platform Team
tcnksm
11
23k
Microservices Platform on Kubernetes at Mercari
tcnksm
16
16k
Introduction to Mercari Micorservices Platform Team
tcnksm
5
3.5k
Other Decks in Technology
See All in Technology
サイバーセキュリティと認知バイアス:対策の隙を埋める心理学的アプローチ
shumei_ito
0
390
Why App Signing Matters for Your Android Apps - Android Bangkok Conference 2024
akexorcist
0
130
Platform Engineering for Software Developers and Architects
syntasso
1
520
CysharpのOSS群から見るModern C#の現在地
neuecc
2
3.5k
IBC 2024 動画技術関連レポート / IBC 2024 Report
cyberagentdevelopers
PRO
1
110
10XにおけるData Contractの導入について: Data Contract事例共有会
10xinc
6
660
【Startup CTO of the Year 2024 / Audience Award】アセンド取締役CTO 丹羽健
niwatakeru
0
1.3k
Amplify Gen2 Deep Dive / バックエンドの型をいかにしてフロントエンドへ伝えるか #TSKaigi #TSKaigiKansai #AWSAmplifyJP
tacck
PRO
0
390
複雑なState管理からの脱却
sansantech
PRO
1
150
ISUCONに強くなるかもしれない日々の過ごしかた/Findy ISUCON 2024-11-14
fujiwara3
8
870
障害対応指揮の意思決定と情報共有における価値観 / Waroom Meetup #2
arthur1
5
480
第1回 国土交通省 データコンペ参加者向け勉強会③- Snowflake x estie編 -
estie
0
130
Featured
See All Featured
Keith and Marios Guide to Fast Websites
keithpitt
409
22k
Ruby is Unlike a Banana
tanoku
97
11k
Side Projects
sachag
452
42k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
Bootstrapping a Software Product
garrettdimon
PRO
305
110k
Rebuilding a faster, lazier Slack
samanthasiow
79
8.7k
Designing on Purpose - Digital PM Summit 2013
jponch
115
7k
Faster Mobile Websites
deanohume
305
30k
GraphQLの誤解/rethinking-graphql
sonatard
67
10k
Automating Front-end Workflow
addyosmani
1366
200k
CoffeeScript is Beautiful & I Never Want to Write Plain JavaScript Again
sstephenson
159
15k
jQuery: Nuts, Bolts and Bling
dougneiner
61
7.5k
Transcript
Deploying Docker Application to DaaS by @deeeet
Taichi Nakashima @deeeet ! • http://deeeet.com/writing (SOTA) • tcnksm/rbdock •
Docker ދͷר, Serf ދͷר
Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service (DaaS)
ʹσϓϩΠ͢Δ
DaaS Docker as a Service Docker ϗεςΟϯάαʔϏε https://orchardup.com/ https://orchardup.com/
DaaS Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service
(DaaS) ʹσϓϩΠ͢Δ https://orchardup.com/ DaaS https://orchardup.com/ https://orchardup.com/
DaaS Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service
(DaaS) ʹσϓϩΠ͢Δ https://orchardup.com/ DaaS https://stackdock.com/
DaaS Rails Application Λ Docker ίϯςφʹͷͤͯ Docker as a Service
(DaaS) ʹσϓϩΠ͢Δ https://orchardup.com/ DaaS http://www.tutum.co/
Orchard • ؆୯ͳίϚϯυϥΠϯϥούʔΛ௨ͯ͡ ϩʔΧϧ͔Βಉ͡ίϚϯυୟ͚ͩ͘Ͱ͑Δ • 1࣌ؒ1ԁ/1݄1000ԁఔͰ͑Δ (512MB RAM/20GB SSD) •
Fig (ίϯςφؒͷ࿈ܞΛࢧԉ͢Δπʔϧ)ͷ ։ൃΛ͍ͯ͠Δ
Environment • OSX • boot2docker • mkwiatkowski/todo-rails4-angularjs (Rails) worked with
ruby2.0.0p-247, postgresql (DB)
Overview Postgresql Container Rails Container :3000 5432:5432
Dockerfile (Rails) $ gem install rbdock $ rbdock 2.0.0-p247 --app
todo-rails4-angularjs https://github.com/tcnksm/rbdock
development: adapter: postgresql template: template0 encoding: unicode database: todo_rails4_angularjs_development pool:
5 username: docker password: docker host: <%= ENV.fetch('DB_PORT_5432_TCP_ADDR') %> port: <%= ENV.fetch('DB_PORT_5432_TCP_PORT') %> http://deeeet.com/writing/2014/03/20/docker-link-container/ config/database.yml
Development at local
$ docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker \
-e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Postgresql Container
$ docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker \
-e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Rails Container $ docker run -i t —p 3000:3000 \ -link pg:db \ tcnksm/rails \ 'rake db:create && rake db:migrate && rails server'
http://localhost:3000
Development at local • มߋ͕ೖͬͨΒ build && run (+Guard) •
VolumesػೳΛ͑ϦΞϧλΠϜߋ৽ (+ ONBUILD)
Docker Share (ngrok) $ orchard hosts create Orchard username: tcnksm
Password: Default host running at 162.243.106.93 $ ngrok 3000 http://36a98c94.ngrok.com -> 127.0.0.1:3000
http://36a98c94.ngrok.com
Deploy to Orchard
Login to Orchard $ orchard hosts create Orchard username: tcnksm
Password: Default host running at 162.243.106.93
$ orchard docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker
\ -e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Postgresql Container
$ docker run -d -p 5432:5432 \ -e POSTGRESQL_USER=docker \
-e POSTGRESQL_PASS=docker \ -name pg \ orchardup/postgresql Rails Container $ orchard docker run -i t —p 80:3000 \ -link pg:db \ tcnksm/rails \ 'rake db:create && rake db:migrate && rails server'
http://162.243.106.93
Conclusion • DaaSʹRails ApplicationΛDeploy • Orchard ͱͯγϯϓϧ -> ϩʔΧϧ͔Βಉ͡ίϚϯυΛୟ͚ͩ͘
Future • HerokuʹpushͱൺͯԿ͕ྑ͍ͷ? -> DockerͰΔརͷٻʢ͖উखͰ͖Δ+αʣ • ίϯςφ্ཱͪ͛ͨޙ? -> ࣮ࡍͷӡ༻
Thanks