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
140
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
250
How to deal with events backpressure in Elixir
andrefreitas
1
230
Vamos (re)aprender Python
andrefreitas
0
58
Other Decks in Programming
See All in Programming
Hanami and htmx
bkuhlmann
0
200
CA.swift19 恋するAIアプリ開発の裏側
oskmr
0
360
Blue/Greenデプロイの導入による 運用フローの改善
kudoas
1
360
#phpcon_odawara オープン・クローズドなテストフィクスチャを求めて / open closed test fixtures
77web
3
220
Site Reliability Engineering for GMO
pyama86
7
1k
デフォルトにして至高、RubyMineの大好きな所
ruzia
0
220
PHP8.3の機能を振り返る / Review of PHP 8.3 features
seike460
PRO
1
110
効率化に挑戦してみたらモバイル開発が少し快適になった話
ryunakayama
0
120
チーム力を高めるスクラム実践法:カンバン公開と課題攻略について - ニフティのスクラムトーク Vol. 2 - NIFTY Tech Talk #18
niftycorp
PRO
1
110
Ruby Function Composition
bkuhlmann
1
330
はてなにおける CSS Modules、及び CSS Modules に足りないもの / CSS Modules in Hatena, and CSS Modules missing parts
mizdra
6
900
GitHub Actionsで泣かないためにやっておきたい設定 / Recommended GHA settings to avoid crying
pinkumohikan
3
520
Featured
See All Featured
How To Stay Up To Date on Web Technology
chriscoyier
782
250k
Stop Working from a Prison Cell
hatefulcrawdad
266
19k
Why You Should Never Use an ORM
jnunemaker
PRO
51
8.6k
The Art of Programming - Codeland 2020
erikaheidi
41
12k
BBQ
matthewcrist
80
8.8k
We Have a Design System, Now What?
morganepeng
42
6.7k
Practical Orchestrator
shlominoach
181
9.7k
The Cult of Friendly URLs
andyhume
74
5.7k
Visualization
eitanlees
135
14k
Code Reviewing Like a Champion
maltzj
513
39k
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
1
3.4k
Raft: Consensus for Rubyists
vanstee
132
6.3k
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/