Chapter

Docker Compose

Describe and run multi-container apps from a single YAML file.

Docker Basics 4 Lessons from courses

About this chapter

Typing long docker commands for every container gets old fast. Docker Compose lets you define your whole app in one file and start it with a single command.

Lessons from courses

  1. 1 What is Docker Compose? What is Docker Compose? Learn how it describes a multi-container app in a single docker-compose.yml file you start with one command.
  2. 2 Writing a docker-compose.yml Write your first docker-compose.yml: define a service with an image and ports, then start it with docker compose up and stop it with down.
  3. 3 Multi-container apps Run a multi-container app with Docker Compose: define several services in docker-compose.yml with automatic networking, volumes and env vars.
  4. 4 Building images and using variables Build your own image in Docker Compose, load variables from a .env file, and control startup order with depends_on between services.
Docker Basics Go to course