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
120
Pushing data with Server Sent Events
andrefreitas
1
130
Dapper - A Large-Scale Distributed Systems Tracing Infrastructure
andrefreitas
1
270
How to deal with events backpressure in Elixir
andrefreitas
1
260
Vamos (re)aprender Python
andrefreitas
0
76
Other Decks in Programming
See All in Programming
[初登壇@jAZUG]アプリ開発者が気になるGoogleCloud/Azure+wasm/wasi
asaringo
0
120
JSAI2025 RecSysChallenge2024 優勝報告
unonao
1
450
Development of an App for Intuitive AI Learning - Blockly Summit 2025
teba_eleven
0
110
インターフェース設計のコツとツボ
togishima
2
690
Elixir で IoT 開発、 Nerves なら簡単にできる!?
pojiro
1
110
レガシーシステムの機能調査・開発におけるAI利活用
takuya_ohtonari
0
570
The Evolution of Enterprise Java with Jakarta EE 11 and Beyond
ivargrimstad
1
550
eBPFを用いたAIネットワーク監視システム論文の実装 / eBPF Japan Meetup #4
yuukit
3
740
Prism.parseで 300本以上あるエンドポイントに 接続できる権限の一覧表を作ってみた
hatsu38
1
110
💎 My RubyKaigi Effect in 2025: Top Ruby Companies 🌐
yasulab
PRO
1
130
機械学習って何? 5分で解説頑張ってみる
kuroneko2828
0
200
型安全RESTで爆速プロトタイピング – Hono RPC実践
tacke_jp
0
110
Featured
See All Featured
How to Think Like a Performance Engineer
csswizardry
24
1.7k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.4k
Building a Modern Day E-commerce SEO Strategy
aleyda
41
7.3k
The World Runs on Bad Software
bkeepers
PRO
68
11k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
507
140k
KATA
mclloyd
29
14k
Building an army of robots
kneath
306
45k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
137
34k
BBQ
matthewcrist
89
9.7k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Why Our Code Smells
bkeepers
PRO
337
57k
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/