What does the depends_on key in a docker-compose.yml file control?

Docker Fundamentals Medium

Docker Fundamentals — Medium

What does the depends_on key in a docker-compose.yml file control?

Key points

  • depends_on specifies startup order in Docker
  • Services start after their dependencies, but not necessarily when dependencies are fully ready
  • Healthchecks can be used to ensure full readiness
  • Combining depends_on with healthcheck ensures proper service initialization

Ready to go further?

Related questions