원클릭으로
docker-compose-helper
Write, debug, and optimize docker-compose.yml files with service definitions, networking, volumes, and healthchecks.
메뉴
Write, debug, and optimize docker-compose.yml files with service definitions, networking, volumes, and healthchecks.
Debug running containers with log analysis, shell access, state inspection, and network diagnostics.
Multi-stage pipelines, sidecar patterns, healthchecks, init containers, signal handling, and graceful shutdown.
Use Docker in CI/CD pipelines with GitHub Actions, multi-platform builds, registry push, and layer caching strategies.
Manage Docker contexts for multi-host and remote Docker engine workflows
Set up development environments with Docker including hot reload, dev containers, bind mounts, and database containers.
Docker Content Trust - image signing, verification, key management, and CI/CD signing pipelines
| name | docker-compose-helper |
| description | Write, debug, and optimize docker-compose.yml files with service definitions, networking, volumes, and healthchecks. |
| standards-version | 1.10.0 |
Use this skill when:
docker-compose.yml or compose.yml from scratch.env files in composedepends_on with condition: service_healthy works correctly..env files for shared config, environment: for service-specific values.condition: service_healthy instead of bare depends_on to avoid race conditions.docker_listContainers, docker_listNetworks, and docker_listVolumes to verify the running stack.User: Create a compose file for a Node.js API with PostgreSQL and Redis.
Agent:
# compose.yml
services:
api:
build:
context: .
dockerfile: Dockerfile
ports:
- "3000:3000"
environment:
DATABASE_URL: postgres://app:secret@db:5432/myapp
REDIS_URL: redis://cache:6379
depends_on:
db:
condition: service_healthy
cache:
condition: service_healthy
volumes:
- ./src:/app/src
restart: unless-stopped
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: app
POSTGRES_PASSWORD: secret
POSTGRES_DB: myapp
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U app -d myapp"]
interval: 5s
timeout: 3s
retries: 5
ports:
- "5432:5432"
cache:
image: redis:7-alpine
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 5s
timeout: 3s
retries: 5
ports:
- "6379:6379"
volumes:
pgdata:
User: How do I add an optional pgAdmin service?
Agent: Use a compose profile so it only starts when you explicitly request it:
pgadmin:
image: dpage/pgadmin4:latest
profiles:
- debug
environment:
PGADMIN_DEFAULT_EMAIL: admin@local.dev
PGADMIN_DEFAULT_PASSWORD: admin
ports:
- "8080:80"
depends_on:
db:
condition: service_healthy
Start it with:
docker compose --profile debug up
User: How do I use a .env file?
Agent: Create a .env file next to your compose.yml:
POSTGRES_USER=app
POSTGRES_PASSWORD=secret
POSTGRES_DB=myapp
Reference in compose:
db:
image: postgres:16-alpine
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
Compose automatically loads .env from the project directory. Use env_file: to load from a custom path.
| Tool | Purpose |
|---|---|
docker_listContainers | Verify all compose services are running and check their status |
docker_inspectContainer | Debug a specific service - check mounts, env vars, network settings |
docker_containerLogs | Read logs from a service to diagnose startup failures |
docker_listNetworks | Confirm compose created the expected networks |
docker_listVolumes | Verify named volumes exist and check mount points |
docker_diskUsage | Check disk consumed by volumes and containers in the stack |
Verifying a compose stack is healthy:
1. Call docker_listContainers to see all running services and their states.
2. For any service not in "running" state, call docker_containerLogs
with the container ID to read error output.
3. Call docker_inspectContainer to check environment variables,
mounts, and network configuration.
Debugging network connectivity between services:
1. Call docker_listNetworks to find the compose network name.
2. Call docker_inspectContainer on each service to verify they
share the same network.
depends_on: [db] only waits for the container to start, not for the service inside to be ready. Always use condition: service_healthy with a healthcheck.latest tags - pin image versions (e.g., postgres:16-alpine) to avoid breaking changes on rebuild..env files (gitignored) or Docker secrets. Never commit passwords to version control.docker_listContainers to see what's already bound.restart: unless-stopped, services won't come back after a Docker daemon restart.volumes: section. Without it, Docker creates anonymous volumes that are hard to track.env_file loads from a file, environment sets inline. Values in environment override env_file.network_mode: host only works on Linux. On macOS/Windows, use port mapping instead.