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
280
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
Laravel Boost 超入門
fire_arlo
3
210
250830 IaCの選定~AWS SAMのLambdaをECSに乗り換えたときの備忘録~
east_takumi
0
390
Android端末で実現するオンデバイスLLM 2025
masayukisuda
1
150
デザイナーが Androidエンジニアに 挑戦してみた
874wokiite
0
410
機能追加とリーダー業務の類似性
rinchoku
2
1.3k
為你自己學 Python - 冷知識篇
eddie
1
350
アプリの "かわいい" を支えるアニメーションツールRiveについて
uetyo
0
270
Testing Trophyは叫ばない
toms74209200
0
870
時間軸から考えるTerraformを使う理由と留意点
fufuhu
16
4.8k
The Past, Present, and Future of Enterprise Java
ivargrimstad
0
370
go test -json そして testing.T.Attr / Kyoto.go #63
utgwkk
3
300
Putting The Genie in the Bottle - A Crash Course on running LLMs on Android
iurysza
0
140
Featured
See All Featured
What's in a price? How to price your products and services
michaelherold
246
12k
Practical Tips for Bootstrapping Information Extraction Pipelines
honnibal
PRO
23
1.4k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
Build your cross-platform service in a week with App Engine
jlugia
231
18k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
61k
Thoughts on Productivity
jonyablonski
70
4.8k
Making the Leap to Tech Lead
cromwellryan
135
9.5k
The Language of Interfaces
destraynor
161
25k
The Cost Of JavaScript in 2023
addyosmani
53
8.9k
Fireside Chat
paigeccino
39
3.6k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
4 Signs Your Business is Dying
shpigford
184
22k
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/