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 Our App on a Swarm

With our newly created docker-stack.yml, we have a description of our app that Swarm can use. We’re ready to deploy our app onto our (single-node) swarm.

First, we must remember to retarget our swarm:

 $ ​​eval​​ ​​$(docker-machine​​ ​​env​​ ​​local-vm-1)

Now we can deploy our app with the command:

 $ ​​docker​​ ​​stack​​ ​​deploy​​ ​​-c​​ ​​docker-stack.yml​​ ​​myapp
 Creating network myapp_default
 Creating service myapp_web
 Creating service myapp_redis
 Creating service myapp_database
 Creating service myapp_db-migrator

This says, “Deploy the services described in docker-stack.yml as a stack called myapp.” You can see the various services being created.

We can list the services in our stack by running:

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