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
160
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
130
Pushing data with Server Sent Events
andrefreitas
1
140
Dapper - A Large-Scale Distributed Systems Tracing Infrastructure
andrefreitas
1
330
How to deal with events backpressure in Elixir
andrefreitas
1
260
Vamos (re)aprender Python
andrefreitas
0
83
Other Decks in Programming
See All in Programming
Ruby and LLM Ecosystem 2nd
koic
1
660
Ruby x Terminal
a_matsuda
7
590
Docコメントで始める簡単ガードレール
keisukeikeda
1
110
RAGでハマりがちな"Excelの罠"を、データの構造化で突破する
harumiweb
9
2.8k
Claude Codeログ基盤の構築
giginet
PRO
7
3.1k
Fundamentals of Software Engineering In the Age of AI
therealdanvega
1
250
RubyとGoでゼロから作る証券システム: 高信頼性が求められるシステムのコードの外側にある設計と運用のリアル
free_world21
0
270
ロボットのための工場に灯りは要らない
watany
10
2.8k
How to stabilize UI tests using XCTest
akkeylab
0
120
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
550
Takumiから考えるSecurity_Maturity_Model.pdf
gessy0129
1
140
「抽象に依存せよ」が分からなかった新卒1年目の私が Goのインターフェースと和解するまで
kurogenki
0
110
Featured
See All Featured
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
130
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
140
Unlocking the hidden potential of vector embeddings in international SEO
frankvandijk
0
200
Fireside Chat
paigeccino
42
3.8k
The Cult of Friendly URLs
andyhume
79
6.8k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Measuring & Analyzing Core Web Vitals
bluesmoon
9
780
Leadership Guide Workshop - DevTernity 2021
reverentgeek
1
240
JAMstack: Web Apps at Ludicrous Speed - All Things Open 2022
reverentgeek
1
390
The Psychology of Web Performance [Beyond Tellerrand 2023]
tammyeverts
49
3.3k
How GitHub (no longer) Works
holman
316
140k
A Tale of Four Properties
chriscoyier
163
24k
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/