Chapter Summary

This lesson is a summary of the contents learned in this chapter.

In this chapter, you learned how to deploy and manage a multi-container application using Docker Compose.

Docker Compose is a Python application that you install on top of the Docker Engine. It lets you define multi-container apps in a single declarative configuration file and deploy it with a single command.

Compose files can be YAML or JSON, and they define all of the containers, networks, volumes, and secrets that an application requires. You then feed the file to the docker-compose command-line tool, and Compose uses Docker to deploy it.

Once the app is deployed, you can manage its entire lifecycle using the many docker-compose subcommands.

You also saw how volumes have a separate lifecycle to the rest of the app and can be used to mount changes directly into containers.

Docker Compose is popular with developers, and the Compose file is an excellent source of application documentation; it defines all the services that make up the app, the images they use, ports they expose, networks and volumes they use, and much more. As such, it can help bridge the gap between dev and ops. You should also treat your Compose files as if they were code. This means, among other things, storing them in source control repositories.

Get hands-on with 1000+ tech skills courses.