Docker Compose
docker compose stop
Stop existing service containers without removing them. Specify a bounded shutdown timeout; the writable layer remains but application process state does not. Record container identity before and after a subsequent start.
Formal Syntax & Structure
docker syntaxdocker
docker compose stop [OPTIONS] [SERVICE...]Parameters & Attributes
| Name | Type | Description |
|---|---|---|
| -t | string | Shutdown timeout in seconds |
| SERVICE | string | Optional selected service |
Working Example
Example Snippetdocker
docker compose -f compose.yaml -p bm-v12-lifecycle stop -t 5 worker