...

/

Introduction to Docker Compose

Introduction to Docker Compose

This lesson provides an overview of Docker Compose.

We'll cover the following...

In this chapter, we’ll deploy and manage a multi-container application using Docker Compose. When we talk about Docker Compose, we usually shorten it to Compose and always write it with a capital “C”.

Docker Compose is a tool for defining and running multi-container Docker applications. Using a YAML file, you can define the services, networks, and volumes that your application requires. This allows you to manage complex applications with multiple containers, making it easier to set up, manage, and scale your environment. By using Docker Compose, you can streamline workflows, ensuring that all services are configured and connected properly, and can be easily deployed and maintained.

Press + to interact

Docker Compose – The TLDR

We create modern cloud-native applications by combining many small services to form a useful app. These applications are called microservices, and they offer many benefits, such as self-healing, autoscaling, and rolling updates. However, they can be complex.

For example, you might have a microservices app with the following services:

  • Web front-end
  • Ordering
  • Catalog
  • Back-end datastore
  • Logging
  • Authentication
  • Authorization

Instead of hacking together complex scripts and long docker commands, Compose lets you describe the application in a simple YAML file called a Compose file. You then use the Compose file with the docker compose command to deploy and manage the app. You should keep your Compose files in a version control system such as Git.

That’s the basics. Let’s dig deeper.