Running an application with Docker Compose

Once we have built our images, we can start the application using Docker Compose:

$ docker-compose up

The output will show us the application starting. We should see the following:

Running the sample application, part 1

In this first part of the output, we see how Docker Compose does the following:

  • Creates a bridge network called ch11_default
  • Creates a volume called ch11_pets-data
  • Creates the two services, ch11_web_1 and ch11_db_1, and attaches them to the network

Docker Compose then also shows log output generated by the database (blue) and by the web service (yellow) that are both stating up. ...

Get Learn Docker - Fundamentals of Docker 19.x - Second Edition 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.