diff --git a/compose/compose-file/index.md b/compose/compose-file/index.md index 6789569276..f676a0af89 100644 --- a/compose/compose-file/index.md +++ b/compose/compose-file/index.md @@ -852,6 +852,9 @@ behaviors: - `docker-compose up SERVICE` automatically includes `SERVICE`'s dependencies. In the following example, `docker-compose up web` also creates and starts `db` and `redis`. + +- `docker-compose stop` stops services in dependency order. In the following + example, `web` is stopped before `db` and `redis`. Simple example: diff --git a/compose/startup-order.md b/compose/startup-order.md index 88477929e2..aef9acfcaf 100644 --- a/compose/startup-order.md +++ b/compose/startup-order.md @@ -1,16 +1,16 @@ --- -description: How to control service startup order in Docker Compose -keywords: documentation, docs, docker, compose, startup, order -title: Control startup order in Compose +description: How to control service startup and shutdown order in Docker Compose +keywords: documentation, docs, docker, compose, startup, shutdown, order +title: Control startup and shutdown order in Compose notoc: true --- -You can control the order of service startup with the -[depends_on](compose-file.md#depends_on) option. Compose always starts +You can control the order of service startup and shutdown with the +[depends_on](compose-file.md#depends-on) option. Compose always starts and stops containers in dependency order, where dependencies are determined by `depends_on`, `links`, `volumes_from`, and `network_mode: "service:..."`. -However, Compose does not wait until a container is "ready" (whatever that means +However, for startup Compose does not wait until a container is "ready" (whatever that means for your particular application) - only until it's running. There's a good reason for this.