Docker Compose container orchestration and management. Manage multi-container applications, services, networks, and volumes. Use for local development, testing, and orchestration of containerized applications.
Install with Codex or Claude Copy this prompt, paste it into Codex, Claude, or another assistant, and let it review the skill page and install it for you.
A direct command skips the review prompt. Inspect the source before running it.
Docker Compose container orchestration and management. Manage multi-container applications, services, networks, and volumes. Use for local development, testing, and orchestration of containerized applications.
version
1
model
sonnet
invoked_by
both
user_invocable
true
tools
["Bash","Read","Glob"]
best_practices
["Verify docker-compose.yml exists before operations","Use project names for isolation","Check service status before destructive operations","Avoid volume removal without confirmation","Review logs before restarting failed services"]
YAML: Use named volumes for DBs (postgres_data:/var/lib/postgresql/data). Use healthchecks (healthcheck: with test, interval, timeout, retries). One network default; reference services by name (e.g. http://api:3000). Use env_file or environment; keep secrets in secrets:.
Hacks:-f compose.yaml -f override.yaml merges files (later overrides). Use --project-name for isolation. Prefer build: context: . dockerfile: Dockerfile for dev; pin image tags in prod. Run docker compose config before up to catch errors.
Suggested hooks: Pre-up: docker compose config (validate). Post-down: optional cleanup. Use when devops or devops-troubleshooter is routed.
Workflows: Use with devops (primary), devops-troubleshooter (primary). Flow: validate compose → up/down/exec per task. See operations/incident-response for container debugging.
Overview
This skill provides comprehensive Docker Compose management, enabling AI agents to orchestrate multi-container applications, manage services, inspect logs, and troubleshoot containerized environments with progressive disclosure for optimal context usage.
# 1. Check container status
docker compose ps --all
# 2. View service logs
docker compose logs --tail 200 failing-service
# 3. Inspect running processes
docker compose top failing-service
# 4. Check configuration
docker compose config
# 5. Restart the service
docker compose restart failing-service
# 6. If needed, recreate container
docker compose up -d --force-recreate failing-service
Update Service Images
# 1. Pull latest images
docker compose pull
# 2. Stop services
docker compose down
# 3. Rebuild if using custom Dockerfiles
docker compose build --pull
# 4. Start with new images
docker compose up -d
# 5. Verify services
docker compose ps
Debug Service Connectivity
# 1. Check running services
docker compose ps
# 2. Inspect port mappings
docker compose port web 80
docker compose port api 3000
# 3. Exec into container
docker compose exec web sh
# 4. Test connectivity (from inside container)
docker compose exec web curl api:3000/health
# 5. Check logs for errors
docker compose logs web api
Clean Up Environment
# 1. Stop all services
docker compose down
# 2. Remove orphaned containers
docker compose down --remove-orphans
# 3. View images
docker compose images
# 4. Clean up (manual - volume removal BLOCKED)# Volumes require manual cleanup with explicit confirmation
The skill uses progressive disclosure to minimize context usage:
Initial Load: Only metadata and tool names (~700 tokens)
Tool Invocation: Specific tool schema loaded on-demand (~100-150 tokens)
Result Streaming: Large outputs (logs) streamed incrementally
Context Cleanup: Old results cleared after use
Context Optimization:
Use --tail to limit log output
Use service filters to target specific containers
Prefer ps over ps --all for active services only
Use --since for time-bounded log queries
Troubleshooting
Skill Issues
Docker Compose not found:
# Check Docker Compose version
docker compose version
# If using V1, try:
docker-compose version
# Update to V2 (recommended)# Docker Compose V2 is integrated into Docker CLI
Permission denied:
# Add user to docker group (Linux)sudo usermod -aG docker $USER
newgrp docker
# Verify permissions
docker ps