Thuta Learning
Docker
AdvancedDevOps & ToolsIntermediate

Docker Compose Intro

DockerLesson 14

Docker Compose is a tool that lets you define a multi-container application in a single file and run it all with one command. For example, instead of writing out each of your web app + database + cache + worker services individually with docker run, you can group them all in docker-compose.yml.

Using Compose makes it easy to share an identical project setup across the whole team. A new developer can clone the project, and just by running the single line docker compose up, most of the services can start up.

Info

The newer Docker Compose command uses a space — docker compose — and that's what's more commonly used now. In older documentation, you'll still see the hyphenated docker-compose.

Easy traps

  • Get the indentation wrong in your compose file, and you'll get a YAML parse error. Use spaces, and make sure keys at the same level line up.

Updated on

Progress is saved only in this browser on this device. It isn't synced to other devices.

Report a problem with this lessonOpens your email app with this lesson's address filled in — nothing is sent until you send it.

Docker Compose Intro | Thuta Learning