docker-compose
Installation
SKILL.md
Docker Compose
Opinionated conventions for consistent, maintainable Docker Compose files.
Best Practices
File naming and override strategy
- Prefer
compose.yaml(orcompose.yml) as the canonical base file. - Keep local-only changes in
compose.override.yaml(auto-merged by Compose).- If an override file is local-only, add it to
.gitignoreunless the team explicitly wants it committed (optionally keep a.examplefile).
- If an override file is local-only, add it to
- For environment-specific configs, use
compose.<env>.yamland combine with-f. - Avoid the top-level
versionkey (obsolete).
Service naming and identity
- Use kebab-case service names; they become internal DNS names.
- Avoid
container_nameunless strictly required; it prevents scaling. - Pin image tags (avoid
latest); prefer digests for production.