mirror of
https://github.com/docker/docs.git
synced 2026-10-29 20:39:05 +03:00
Merge pull request #6138 from msgeissler/patch-1
Add shutdown order information for depends_on
This commit is contained in:
@@ -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:
|
||||
|
||||
|
||||
@@ -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.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user