Mid-level Track Roadmap

Docker Compose

Docker Compose describes a multi-container development environment as one file in the repository, started with docker compose up. The lessons use a Rails application and its PostgreSQL database. They cover the current file format without the obsolete version key, service names as hostnames, and health checks that wait for readiness. They also cover named volumes and bind mounts, configuration and secrets kept out of the repository, and everyday commands. The course ends with a complete compose.yaml for the app and the five failures that cost the most time.

What you'll learn

  • ✓Writing a compose.yaml with services, images, builds and YAML anchors
  • ✓How services find each other by name and when to publish ports
  • ✓Using health checks so depends_on waits for readiness
  • ✓Choosing between named volumes and bind mounts, and the problems each one brings
  • ✓Keeping secrets out of the repository with .env, interpolation and Compose secrets
  • ✓Daily commands: exec, run, profiles, watch and docker compose config
Free preview · Lesson 1 4 min read

One container is not an environment

The previous course ended with an image that runs this application. That is one process. A working environment for this app is at least two, because the app needs PostgreSQL, and a realistic one adds a job worker and sometimes more.

Read the full lesson free →

Curriculum

7 lessons
Type to start searching...