Docker Compose Operator Skill
Stateless atomic operation to compile template compose definitions, resolve active environment parameter overlays, deploy/restart Docker containers or Swarm stacks safely, and monitor container execution logs to verify operational health.
Prerequisites
container-manager-mcp — for initiating compose actions (up, down, ps, logs), deploying service stacks, and monitoring process readiness.
Steps
Step 1: compile_compose_manifest
Assemble the targeted deployment specifications and validate syntax and overrides:
- Locate the reference compose YAML file (e.g.
docker-compose.yml or stack.yml) and its corresponding .env or configuration parameters.
- Substitute template variables, environment configuration keys, and host path references.
- Execute validation on the compiled compose syntax (e.g. verify YAML validity, check that image references are fully qualified, and check that required volume mounts exist on the host).
- Output parameters:
manifest_valid: Boolean indicating successful compilation.
resolved_manifest_path: Absolute path to the validated temporary compose file.
Step 2: execute_compose_deployment [depends_on: compile_compose_manifest]
Execute deployment operations with safety checks:
- Trigger container launch:
- Invoke
up or stack deploy operations via container-manager-mcp (e.g., using cm_compose_operations).
- Pass the compiled configuration file and specify proper namespace/stack definitions.
- Coordinate dependencies and rolling replacements:
- Verify if pre-requisite backing databases or network subnets are operational before launching core app containers.
- Enforce graceful termination timeouts for old container replicas to prevent socket drops.
- Output parameters:
deployment_exit_code: Int process return code.
deployment_raw_output: String command outputs.
Step 3: verify_operational_health [depends_on: execute_compose_deployment]
Perform granular verification of the active containers to ensure readiness and stability:
- Poll container states:
- Wait for containers to exit boot phases, querying runtime statuses (
running, healthy, restarting).
- Log inspection and error parsing:
- Retrieve and parse container stdout/stderr logs (e.g. using
get_container_logs action).
- Scan for common startup exceptions (e.g.,
ConnectionRefusedError, Database error, Exception).
- readiness probes:
- If web ports or health check endpoints are mapped, test their accessibility (expecting standard
200 OK or valid TCP socket connections).
- Output parameters:
status: "SUCCESS" or "FAILED"
active_containers: List of running service instances with their states.
health_log_summary: Summary of any anomalies or startup errors discovered.
1---2name: docker-compose-operator-23skill_type: skill4description: >5 Universal Docker Compose and Swarm operation and deployment atomic skill.6 Compiles environment templates, triggers service deploys, and monitors operational health.7domain: system8license: MIT9tags: [docker, compose, swarm, deployment, system]10metadata:11 source: https://skillmd.com/skills/knuckles-team/docker-compose-operator-212 version: '1.6.0'13 author: Genius14requires:15 - container-manager-mcp16---1718# Docker Compose Operator Skill1920Stateless atomic operation to compile template compose definitions, resolve active environment parameter overlays, deploy/restart Docker containers or Swarm stacks safely, and monitor container execution logs to verify operational health.2122## Prerequisites2324- `container-manager-mcp` — for initiating compose actions (`up`, `down`, `ps`, `logs`), deploying service stacks, and monitoring process readiness.2526## Steps2728### Step 1: compile_compose_manifest29Assemble the targeted deployment specifications and validate syntax and overrides:30- Locate the reference compose YAML file (e.g. `docker-compose.yml` or `stack.yml`) and its corresponding `.env` or configuration parameters.31- Substitute template variables, environment configuration keys, and host path references.32- Execute validation on the compiled compose syntax (e.g. verify YAML validity, check that image references are fully qualified, and check that required volume mounts exist on the host).33- Output parameters:34 - `manifest_valid`: Boolean indicating successful compilation.35 - `resolved_manifest_path`: Absolute path to the validated temporary compose file.3637### Step 2: execute_compose_deployment [depends_on: compile_compose_manifest]38Execute deployment operations with safety checks:39- Trigger container launch:40 - Invoke `up` or stack `deploy` operations via `container-manager-mcp` (e.g., using `cm_compose_operations`).41 - Pass the compiled configuration file and specify proper namespace/stack definitions.42- Coordinate dependencies and rolling replacements:43 - Verify if pre-requisite backing databases or network subnets are operational before launching core app containers.44 - Enforce graceful termination timeouts for old container replicas to prevent socket drops.45- Output parameters:46 - `deployment_exit_code`: Int process return code.47 - `deployment_raw_output`: String command outputs.4849### Step 3: verify_operational_health [depends_on: execute_compose_deployment]50Perform granular verification of the active containers to ensure readiness and stability:51- Poll container states:52 - Wait for containers to exit boot phases, querying runtime statuses (`running`, `healthy`, `restarting`).53- Log inspection and error parsing:54 - Retrieve and parse container stdout/stderr logs (e.g. using `get_container_logs` action).55 - Scan for common startup exceptions (e.g., `ConnectionRefusedError`, `Database error`, `Exception`).56- readiness probes:57 - If web ports or health check endpoints are mapped, test their accessibility (expecting standard `200 OK` or valid TCP socket connections).58- Output parameters:59 - `status`: "SUCCESS" or "FAILED"60 - `active_containers`: List of running service instances with their states.61 - `health_log_summary`: Summary of any anomalies or startup errors discovered.