Skip to content

Docker Compose Recipes For Local Dev Textbook

A free, self-paced textbook in 8 chapters. Read a chapter, then drill it with the 217 companion flashcards using spaced repetition.

8 chapters · 217 cards · Updated

Chapters

  1. 1Compose File Anatomy

    A Docker Compose file is a YAML document that describes a multi-container application. In Compose v2, the modern format no longer requires a top-level version: field; the schema is...

  2. 2Services, Dependencies, and Health

    The depends_on: key controls the order in which Compose starts services, but it has a sharp edge that catches almost everyone the first time. The short form depends_on: [db, redis]...

  3. 3Volumes, Mounts, and Data Persistence

    Compose supports three flavors of persistent storage, and choosing the right one matters. A bind mount maps a host path into the container, written as ./local:/app, with optional r...

  4. 4Networking in Compose

    Every Compose project gets a default network named <project>_default, and on that network services can resolve each other by service name. That name resolution is what makes...

  5. 5Building, Scaling, and Resources

    The build: key tells Compose how to construct an image for a service. The simplest form is just a path to a directory containing a Dockerfile, but a richer form lets you specify th...

  6. 6Multi-Environment Compose and Configuration

    One of Compose's most powerful features is the ability to split a configuration across multiple files and merge them. The conventional layout is a base docker-compose.yml containin...

  7. 7Logs, Debugging, and Common Gotchas

    Debugging a Compose project starts with the docker compose ps command, which shows the status of every service, and the docker compose logs command, which prints container output....

  8. 8Stack-Specific Recipes and Patterns

    For Postgres, the canonical Compose service sets POSTGRES_USER, POSTGRES_PASSWORD, and POSTGRES_DB environment variables to create a database on first run, mounts a named volume on...

← Back to the Docker Compose Recipes For Local Dev deck