# Docker Compose

> Use when: define multi-service local and test environments with Docker Compose reliably.

- Skill: `kimtth/docker-compose` (Agent Skill)
- Install (CLI): `npx skillmds@latest add kimtth/docker-compose`
- Raw SKILL.md: https://api.skillmd.com/api/skills/kimtth/docker-compose/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: DevOps & Infra
- Author: kimtth (https://skillmd.com/u/kimtth)
- Updated: 2026-09-17
- Page: https://skillmd.com/skills/kimtth/docker-compose

---


Goal: reproducible multi-service environments that start cleanly.

Use for:
- running an app with its databases and dependencies locally
- standing up integration-test environments
- reviewing compose files for correctness and safety

Workflow:
1. Define one service per container with a clear image and build.
2. Use healthchecks and depends_on conditions for startup order.
3. Pass configuration via environment and .env, not hardcoding.
4. Persist data with named volumes; mount code for dev only.
5. Define networks to isolate and connect services.
6. Verify a clean up/down cycle from scratch.

Practices:
- pin image versions, not latest
- healthchecks so dependents wait for readiness
- named volumes for stateful services
- separate override files for dev vs. test

Rules:
- never bake secrets into images or compose files
- pin versions for reproducibility
- make depends_on wait on health, not just start
- keep the environment disposable and rebuildable

