Docker Compose — Introduction
Welcome to Chapter 1 of the Docker Compose tutorial. This chapter introduces Docker Compose — what it is, why it exists, and when you should use it.
Topics in This Chapter
| # | Topic | Description |
|---|---|---|
| 1 | What is Docker Compose | The problem Compose solves and how it works |
| 2 | Compose V1 vs V2 | History, differences, and migration |
| 3 | When to Use Compose | Use cases and when NOT to use Compose |
| 4 | Compose vs Docker Run | Side-by-side comparison |
| 5 | Compose Ecosystem | Tools, integrations, and community |
What You’ll Learn
By the end of this chapter, you’ll understand:
- What Docker Compose is and the problem it solves
- The difference between Compose V1 and V2
- When to use (and when NOT to use) Compose
- How Compose compares to running
docker runcommands manually - The Compose ecosystem and related tools
Key Concepts Preview
┌─────────────────────────────────────────────────────┐
│ compose.yml │
│ │
│ ┌──────────┐ ┌──────────┐ ┌──────────┐ │
│ │ web │ │ api │ │ db │ │
│ │ (nginx) │ │ (node) │ │ (postgres)│ │
│ └────┬─────┘ └────┬─────┘ └────┬─────┘ │
│ │ │ │ │
│ └──────────────┴──────────────┘ │
│ shared network │
└─────────────────────────────────────────────────────┘
One file. One command. All containers.
Learning Objectives
After completing this chapter, you should be able to:
- Explain Docker Compose in one sentence
- Describe the problem Compose solves
- Differentiate between Compose V1 and V2
- List 3 scenarios where Compose is the right tool
- List 2 scenarios where Compose is NOT the right tool