docker_compose_control
Bring Docker Compose services up or down, report actual container status from the daemon, and refuse destructive volume deletion unless confirmation is provided.
Instructions
Brings the stack up or takes it down, and reports the containers standing afterwards as read from the daemon, not as compose described them. A stack that half came up says so instead of passing for a success. Taking volumes down with it destroys their data and is refused without confirm.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| build | No | Rebuild the images before starting, for action up. Default: false. | |
| scale | No | How many copies of a service to run, for action up: {"web": 3}. | |
| action | Yes | up: create and start the services, always in the background. down: stop and remove the containers of the project. | |
| confirm | No | Written out as "# CONFIRMED-DESTRUCTIVE", this allows deleting volumes for one call. Anything else leaves the refusal standing. | |
| profile | No | Which Docker host, by profile name. Default: the profile marked as default. | |
| project | No | Which compose project. Default: the project of the working directory. A name matching nothing is an error, not a fall back to every container on the host. | |
| timeout | No | Seconds each container gets to shut down before Docker kills it, for action down. Default: 10. | |
| volumes | No | Delete the volumes of the project along with the containers, for action down. The data inside them is destroyed and does not come back, so the call is refused without confirm. Default: false. | |
| services | No | Only these services, for action up. Default: every service of the file. | |
| compose_path | No | Where the compose file is: the file itself, or the directory holding it. Needed only when no container of the host carries the project label — a project that was never brought up there. A directory holding several compose files is refused with their names rather than guessed through. | |
| removeOrphans | No | Remove containers left behind by services no longer in the file, for action down. Default: false. |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| action | No | ||
| legend | No | What the words in this answer mean. A key names the field before the value — "state=running", "containers[].health=unhealthy" — and only the values this answer used are listed. | |
| output | No | ||
| reason | No | ||
| project | No | ||
| removed | No | ||
| services | No | ||
| confirmed | No | ||
| destroyed | No | ||
| compose_file | No |