Launching Our App

With our docker-compose.yml in hand, Compose is now set up to manage our application. However, before we start our app, first a tiny bit of housekeeping. By default, Ruby buffers output to stdout, which doesn’t play well with Compose.[21] Let’s fix this by switching off Ruby’s output buffering.

Add the following line to the top of your config/boot.rb file:

 $stdout.​sync​ = ​true

With that out of the way, we’re ready to launch our app. Instead of the long docker run command, we can now use:

 $ ​​docker-compose​​ ​​up

Before we go through the output, let’s discuss what this command does.

When you run docker-compose up, Compose makes sure that the necessary resources have been set up, creating any that are missing before ...

Get Docker for Rails Developers now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.