Docker Compose
Run multi-container apps with Docker Compose: services and builds, environment and interpolation, health checks and startup order, volumes, secrets, networks, override files and profiles, with every configuration checked by docker compose config.
What you'll learn
- Describe multi-container applications in a Compose file with services, builds, ports and environment.
- Use .env files, interpolation, required variables and YAML anchors, and validate files before running.
- Order startup with health checks and depends_on conditions, and choose restart policies.
- Persist data with named volumes, mount code with bind mounts, and pass secrets as files.
- Isolate traffic with networks and expose only what is needed.
- Manage development and production differences with override files, -f and profiles.
Syllabus
Compose Fundamentals
Defining Services
Interpolation, .env Files and Validation
- Interpolation and the .env File
- Required Variables
- Environment Precedence Inside Containers
- Validating With docker compose config