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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
André Freitas
September 24, 2016
Programming
170
1
Share
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
More Decks by André Freitas
See All by André Freitas
Tooling for updating large tables in Postgres
andrefreitas
1
130
Pushing data with Server Sent Events
andrefreitas
1
150
Dapper - A Large-Scale Distributed Systems Tracing Infrastructure
andrefreitas
1
340
How to deal with events backpressure in Elixir
andrefreitas
1
260
Vamos (re)aprender Python
andrefreitas
0
84
Other Decks in Programming
See All in Programming
プラグインで拡張される Context をtype-safe にする難しさと設計判断
kazupon
2
520
AIエージェントと協働するCLI開発 — BunとOpenClawで学んだこと
yoshikouki
1
230
AI時代の仕事技芸論 — ソフトウェア開発で「遊ぶように働く」職人的熟達のすすめ
kuranuki
1
560
CSC307 Lecture 17
javiergs
PRO
0
310
Old Dog, New Tricks: The Java 25 Reinvention - JNation
bazlur_rahman
0
140
AIとRubyの静的型付け
ukin0k0
0
490
RailsTokyo 2026#4: AI様があれば、 Hotwireの弱点は消えるか?
naofumi
5
1k
RTSPクライアントを自作してみた話
simotin13
0
400
[KCD Czech] eBPF Meets the GPU: Future of AI Infra Observability
doniacld
0
130
Java × distroless で 軽量なコンテナイメージを / Java on Distroless
contour_gara
0
440
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
210
Moments When Things Go Wrong
aurimas
3
130
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Agile Leadership in an Agile Organization
kimpetersen
PRO
0
160
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
540
Building the Perfect Custom Keyboard
takai
2
780
The Art of Programming - Codeland 2020
erikaheidi
57
14k
Marketing to machines
jonoalderson
1
5.3k
Ten Tips & Tricks for a 🌱 transition
stuffmc
0
120
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
540
Designing Powerful Visuals for Engaging Learning
tmiket
1
390
My Coaching Mixtape
mlcsv
0
140
The World Runs on Bad Software
bkeepers
PRO
72
12k
Accessibility Awareness
sabderemane
1
130
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/