Intermediate Reading #docker #yaml #devops #postgresql

Reading a docker-compose.yml Configuration

5 exercises — read a realistic Docker Compose file with three services (web, db, redis). Understand depends_on, port mapping, volumes, healthchecks, and environment variable behavior.

docker-compose.yml reading guide
  • services: → each named block is one container
  • ports: "HOST:CONTAINER" → left = your machine, right = inside container
  • depends_on: → startup order; service_healthy waits for healthcheck to pass
  • volumes: → named volumes persist data; bind mounts (./path) map host directories
  • environment: → env vars passed into the container; NOT shared between services automatically
0 / 5 completed
1 / 5
docker-compose.yml — web/db/redis stack
{ex.passage}
What does the `depends_on` directive control for the web service in this file?