Skip to Content
Docker for Rails Developers
book

Docker for Rails Developers

by Rob Isenberg
February 2019
Intermediate to advanced
240 pages
5h 25m
English
Pragmatic Bookshelf
Content preview from Docker for Rails Developers

Deploying to Our DigitalOcean Swarm

We now have a three-node cluster in DigitalOcean. The next step is to deploy our app onto it. With Swarm, we use the same process whether we’re deploying to a one-node cluster (as we did in the previous chapter), a three-node cluster (as we’re about to do), or even a twenty-node cluster.

We start by configuring our Docker CLI to point to one of the manager nodes in the swarm (it’s possible to have more than one manager). We can do this with docker-machine by setting the environment variables for the manager node:

 $ ​​eval​​ ​​$(docker-machine​​ ​​env​​ ​​do-manager-1)

Then, deploying our application is just a matter of running the docker stack deploy command. Let’s do this now:

 $ ​​docker​​ ​​stack ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Learn Rails 6: Accelerated Web Development with Ruby on Rails

Adam Notodikromo
Mastering Ruby Closures

Mastering Ruby Closures

Benjamin Tan Wei Hao

Publisher Resources

ISBN: 9781680506730Errata Page