compose_wait
Block until specified Docker Compose services stop, then return their exit codes. Use for one-shot or batch jobs; set a timeout to avoid waiting indefinitely on long-running services.
Instructions
Block until the named service containers stop, then return their exit codes.
For one-shot / batch services. A long-running service that never exits blocks until
timeout_seconds, then the subprocess is killed (TimeoutExpired) - bound it sensibly.
Exit codes are on stdout. For a single container use container_wait; for swarm services
use service_wait.
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:
services: One or more services to wait on. At least one is required.
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: Compose project name override
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 | Yes | ||
| project_dir | No | ||
| project_name | No | ||
| timeout_seconds | No |