Skip to content
masterclass Buddy

Docker · Option

depends_on

The depends_on attribute controls the order in which Compose starts and removes services. Long syntax can also wait for a dependency to start, become healthy, or complete successfully.

Last updated

Since
2.17.0 for the long-form restart field

Syntax

services:
  dependent:
    depends_on:
      dependency:
        condition: service_healthy
        restart: true

In-depth API docs are only for subscribers: parameters, examples, common mistakes and interview practice.

Subscribe
  • healthcheck
  • services
  • build
  • image
  • networks

Source: Define services in Docker Compose. Checked 2026-11-03.