Getting started with Docker Compose

Docker Compose is a Docker tool that is used to run multiple containers as a single service. For example, we have an application that requires ACCOUNT-SERVICE and CUSTOMER-SERVICE, so, you could create only one file, which will be used to start and stop the containers as a single service without the need to start and stop individually.

In this section, we will discuss Docker Compose and see how to get started with it. Then, we will look at how to get a single service with ACCOUNT-SERVICE and CUSTOMER-SERVICE up and running using Docker Compose.

As we have seen, each individual container has its own Docker command and particular Dockerfile. This Dockerfile is suitable for creating individual containers. But an enterprise system is not about a single container; it must have multiple containers to operate on a network of isolated applications, or the container management quickly becomes cluttered.

Docker Compose comes into the picture to solve that with its own build file in YAML format, which is better suited to managing multiple containers. For example, it is able to start or stop a composite of services in one command or merge logging output of multiple services together into one pseudo-tty. It is a great tool for development, testing, and staging environments. Let's see how to install Docker Compose on your machine.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.188.190.175