compose_restart
Restart Compose services without recreating containers or reapplying config changes. Use to bounce a service after a runtime file change or to clear in-memory state.
Instructions
Stop then start services without recreating containers or applying config changes.
Use this to bounce a service (e.g. to pick up a runtime file change or clear an
in-memory state). If the compose file has changed (new image, environment, volumes,
ports) use compose_up instead - it recreates affected containers to apply the diff.
stop_timeout_seconds controls the SIGTERM grace period before Docker sends SIGKILL.
Does not raise on a non-zero CLI exit (a missing compose plugin or a timeout still raises) - inspect
returncode/stderr in the result.
Args:
project_dir: Dir with the compose file (default: server cwd; copied to the target host if no local plugin)
files: Explicit compose file paths (repeatable, -f)
project_name: Override the compose project name
services: Restart only these services; omit to restart all
stop_timeout_seconds: Seconds to wait for graceful stop before SIGKILL
timeout_seconds: Subprocess timeout (default 300s)
Returns: dict: {"returncode": int, "stdout": str, "stderr": str, "truncated": bool}
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| files | No | ||
| services | No | ||
| project_dir | No | ||
| project_name | No | ||
| timeout_seconds | No | ||
| stop_timeout_seconds | No |