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
Rails and Docker in Production at NDrive
Search
André Freitas
September 24, 2016
Programming
1
150
Rails and Docker in Production at NDrive
Our experience in deploying Ruby on Rails webservices with Docker and Ansible in Production.
André Freitas
September 24, 2016
Tweet
Share
More Decks by André Freitas
See All by André Freitas
Tooling for updating large tables in Postgres
andrefreitas
1
110
Pushing data with Server Sent Events
andrefreitas
1
130
Dapper - A Large-Scale Distributed Systems Tracing Infrastructure
andrefreitas
1
260
How to deal with events backpressure in Elixir
andrefreitas
1
250
Vamos (re)aprender Python
andrefreitas
0
74
Other Decks in Programming
See All in Programming
Zoneless Testing
rainerhahnekamp
0
150
各クラウドサービスにおける.NETの対応と見解
ymd65536
0
230
fs2-io を試してたらバグを見つけて直した話
chencmd
0
270
KMP와 kotlinx.rpc로 서버와 클라이언트 동기화
kwakeuijin
0
270
Flatt Security XSS Challenge 解答・解説
flatt_security
0
490
htmxって知っていますか?次世代のHTML
hiro_ghap1
0
390
良いユニットテストを書こう
mototakatsu
11
3.4k
Spatial Rendering for Apple Vision Pro
warrenm
0
330
EC2からECSへ 念願のコンテナ移行と巨大レガシーPHPアプリケーションの再構築
sumiyae
3
530
Go の GC の不得意な部分を克服したい
taiyow
3
950
コンテナをたくさん詰め込んだシステムとランタイムの変化
makihiro
1
170
Scalaから始めるOpenFeature入門 / Scalaわいわい勉強会 #4
arthur1
1
380
Featured
See All Featured
It's Worth the Effort
3n
183
28k
The Straight Up "How To Draw Better" Workshop
denniskardys
232
140k
How to Ace a Technical Interview
jacobian
276
23k
The Success of Rails: Ensuring Growth for the Next 100 Years
eileencodes
44
6.9k
Documentation Writing (for coders)
carmenintech
67
4.5k
個人開発の失敗を避けるイケてる考え方 / tips for indie hackers
panda_program
97
17k
Stop Working from a Prison Cell
hatefulcrawdad
267
20k
Building Better People: How to give real-time feedback that sticks.
wjessup
366
19k
Building Adaptive Systems
keathley
38
2.3k
Build The Right Thing And Hit Your Dates
maggiecrowley
33
2.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
330
21k
Fireside Chat
paigeccino
34
3.1k
Transcript
Rails and Docker in Production at NDrive André Freitas github.com/andrefreitas
Euruko 2016
We build offline gps navigation apps
We have microservices Made with Ruby on Rails, Golang and
Python
How we build any Rails service? FROM docker.ndrive.com/rails ONBUILD COPY
Gemfile* /code/ ONBUILD RUN bundle install --without="development test" ONBUILD COPY . /code ONBUILD RUN chown 99:99 -R /code ONBUILD USER 99 ONBUILD ARG version ONBUILD LABEL com.ndrive.version=$version DOCKER_TAG=0.1.0 make docker-build docker-push
How we deploy? ansible-playbook site.yml -i production.ini --limit web1.ndrive.com --tags
store environment server or group of servers service
- name: container docker: name: auth state: reloaded restart_policy: always
pull: always net: bridge log_driver: journald image: "docker.ndrive.com/auth:{{ auth.tag }}" ports: - "4001:4001" volumes: - /srv/settings/auth.json:/code/config/settings.json Example of an Ansible Role
Dashboard of Containers (Rancher)
Logs - Rails logs to stdout - Container sends logs
to Journald journalctl CONTAINER_NAME=auth -f
Pros of Docker - Configuration of servers is simple -
We build all in a single artifact (Docker image) - Less surprises in deployments - Easy to spin up a test environment (CI) - Friend of microservices
Cons of Docker - We need to know how to
deal with Docker issues - Low maturity in orchestration (maybe Swarm or Rancher in the future) - Risky for databases
Links - http://docs.ansible.com/ansible/docker_contain er_module.html - http://rancher.com/rancher/