docker-compose
Skill109 starsChanged 4 months agoMITView on GitHub
Use Docker Compose to define, run, debug, and harden multi-container applications. Load for compose.yaml design, networking, volumes, secrets, profiles, overrides, watch mode, lifecycle operations, or troubleshooting. Do not use this skill for unrelated requests; route to the nearest named specialist.
- Reads credentials
7 other projects use a version of this.
Adopted by
Most recently taken up by
- rafaelob/pragmatic-agent-skillstheir own version, first seen Oct 5, 2026
- gordonmurray/data-engineering-skillstheir own version, first seen Jul 29, 2026
- aborroy/aiup-alfrescotheir own version, first seen Jun 22, 2026
- brpaz/agent-skillstheir own version, first seen May 17, 2026
- kevinnft/ai-agent-skillstheir own version, first seen May 12, 2026
- nbsp1221/agent-skillstheir own version, first seen Mar 10, 2026
Other versions7 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 7
- gordonmurray/data-engineering-skills★ 39same name
- rafaelob/pragmatic-agent-skills★ 23same name
- aborroy/aiup-alfresco★ 14same name
- kevinnft/ai-agent-skills★ 13same name
- JohnJBoren/claude-skills-ecosystem★ 2same name
- brpaz/agent-skills★ 1same name
- nbsp1221/agent-skills★ 0same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository180 other files it gives its agents.
- agent-production-operations/AGENTS.mdAGENTS.md
- AGENTS.mdAGENTS.md
- forward-deployed-engineering/AGENTS.mdAGENTS.md
- production-excellence/AGENTS.mdAGENTS.md
- product-lifecycle/AGENTS.mdAGENTS.md
- tailscale/AGENTS.mdAGENTS.md
- workflow-architect/AGENTS.mdAGENTS.md
- llms.txtllms.txt
- actuarial-risk-modelingSkill
- adr-authoringSkill
- agent-councilSkill
- agent-evals-and-observabilitySkill
- agent-production-operationsSkill
- agent-skillsSkill
- ai-governanceSkill
- ai-operating-economicsSkill
- analog-occultismSkill
- anydocSkill
- api-design-and-evolutionSkill
- artifact-pyramidsSkill
- ascii-city-engineSkill
- autogenSkill
- backend-engineeringSkill
- binary-analysisSkill
- bmadSkill
- brand-designerSkill
- c4-diagrammingSkill
- capacity-and-cost-engineeringSkill
- chief-of-staff-methodologySkill
- cli-builderSkill
- cncf-landscapeSkill
- color-managementSkill
- community-guidesSkill
- conditional-customer-successSkill
- confluence-cliSkill
- constrained-optimizationSkill
- crewaiSkill
- crmSkill
- crowdsecSkill
- cryptpadSkill
- cyberpunkSkill
- daily-life-discoverySkill
- data-architectSkill
- data-cleaningSkill
- data-engineeringSkill
- data-scientistSkill
- de-spinSkill
- digital-twinSkill
- documentsSkill
- dsm5Skill
- dspySkill
- electronicsSkill
- emailSkill
- enterprise-architectureSkill
- epubSkill
- esp32-developmentSkill
- ffmpegSkill
- financial-modelingSkill
- firefliesSkill
- flaresolverr-cliSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
9 rules. 0 are common, 3 are distinctive, and 6 are very specific to this project.
0
Common
Most of the 5 edited versions we read keep these.
3
Distinctive
This author's own choices. Worth a look.
6
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 37
Use the default network for simple projects.
- Distinctive: line 38
Use bind mounts for source/configuration during development, named volumes for state, and read-only mounts for immutable inputs.
- Very specific: line 39
Put credentials in Compose secrets or an external secret manager, not in images, Git, or ordinary environment variables.
- Distinctive: line 40
Use profiles for optional tools such as debugging, migrations, observability, or GPU workloads.
- Very specific: line 44
Treat deploy fields as implementation-dependent.
- Very specific: line 70
When compose.override.yaml exists beside compose.yaml and no -f files are supplied, Compose loads the override automatically.
- Very specific: line 71
Destructive CI gate: never run down --volumes until docker compose -p ci-${CI_JOB_ID:?CI_JOB_ID is required} config --services confirms the …
- Very specific: line 72
Treat deploy resource and placement fields as target-dependent: a rendered field can be valid while the local implementation ignores it.
- Distinctive: line 121
Use an orchestrator-specific skill for Kubernetes, Swarm scheduling, or another platform's deployment controller.
“Common” is measured: kept by at least 6 in 10 of the 5 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docker Compose
Use this skill for the whole Compose lifecycle: model the application, validate the resolved configuration, start or update services, inspect runtime state, and diagnose failures. Prefer the current Compose Specification. Do not add a top-level version key to new files: it is obsolete and does not select a schema.
Operating loop
- Discover the Compose file(s), project directory, env files, profiles, external resources, and whether the task is development, CI, staging, or production.
- Model the application with services, named volumes for durable state, explicit networks for isolation, secrets for sensitive files, and profiles for optional services.
- Resolve before running:
docker compose -f compose.yaml config --quiet docker compose -f compose.yaml config docker compose -f compose.yaml config --services - Operate with the narrowest command:
up -d SERVICE,restart SERVICE,run --rm SERVICE COMMAND, orexec SERVICE COMMAND. Avoiddown -vunless data deletion is intentional and confirmed. - Verify with
ps, health status, logs, an in-container check, and the externally published endpoint where applicable. - Diagnose in order: resolved model → container state → logs → healthcheck → network membership/DNS → mounts/permissions → image/build architecture → host resources.
Decision rules
depends_oncontrols creation order, not readiness. Use a realhealthcheckpluscondition: service_healthy; useservice_completed_successfullyfor migrations or jobs. Do not usesleepas readiness logic.- Containers reach sibling services by service name and container port (
db:5432), not host-published ports or container IPs. - Use the default network for simple projects. Use separate networks to isolate tiers,
internal: truefor a network with no external gateway, and an explicitly namedexternal: truenetwork only when it is created outside the project. - Use bind mounts for source/configuration during development, named volumes for state, and read-only mounts for immutable inputs. Treat host-path mounts as platform-sensitive.
- Put credentials in Compose secrets or an external secret manager, not in images, Git, or ordinary environment variables. Grant each secret only to services that need it. Compose secrets are mounted at
/run/secrets/<name>. - Use profiles for optional tools such as debugging, migrations, observability, or GPU workloads. Core services should have no profile.
- Resolve interpolation explicitly. Shell variables override
--env-file, which overrides the project.env; use${REQUIRED:?explain}for mandatory values and$$for a literal dollar sign. For example, writetest: ["CMD-SHELL", "pg_isready -U $${POSTGRES_USER}"]when the container shell, not Compose, must expand the variable. Check withdocker compose config --environment. - In multi-file merges, later files are applied to the base. Relative paths resolve from the first/base file. Inspect the result with
docker compose config; use!resetor!overridewhen ordinary merge behavior is not what you want. - Compose Watch is for services built from local source. Use
syncfor hot-reloadable source,sync+restartfor configuration, andrebuildfor dependency or image changes. The container user must be able to write to the target path. - Treat
deployfields as implementation-dependent. Verify what the target Compose implementation enforces; the specification explicitly allows partial support.
Quick command card
docker compose version
docker compose config --quiet
docker compose up -d --build
docker compose ps
docker compose logs -f --tail=100 SERVICE
docker compose exec SERVICE COMMAND
docker compose run --rm SERVICE COMMAND
docker compose restart SERVICE
docker compose stop
docker compose down # preserves named volumes
docker compose down --remove-orphans
docker compose pull && docker compose up -d
docker compose --profile debug up -d
docker compose up --watch
docker compose port SERVICE CONTAINER_PORT
docker network inspect PROJECT_default
docker volume inspect PROJECT_VOLUMEHigh-value defaults
- When
compose.override.yamlexists besidecompose.yamland no-ffiles are supplied, Compose loads the override automatically; use explicit-ffiles for production combinations. - Destructive CI gate: never run
down --volumesuntildocker compose -p ci-${CI_JOB_ID:?CI_JOB_ID is required} config --servicesconfirms the isolated project name; on shared environments, omit--volumesunless the exact data scope is intentional. - Treat
deployresource and placement fields as target-dependent: a rendered field can be valid while the local implementation ignores it. Verify enforcement at runtime.
Base/dev/prod command matrix
# Base or default development override
docker compose config --quiet
docker compose up --watch
# Explicit production model
IMAGE_TAG=release-1 docker compose -f compose.yaml -f compose.prod.yaml config --quiet
IMAGE_TAG=release-1 docker compose -f compose.yaml -f compose.prod.yaml up -d
# Optional tooling
docker compose --profile debug up -dThe default compose.override.yaml is auto-loaded; production overrides must be selected explicitly.
Rendered configuration is not runtime proof. config can confirm a secret declaration, resource limit, or healthcheck is present, but only runtime inspection proves the secret file is mounted, the healthcheck passes, or the target implementation enforces deploy limits. Verify with exec, ps, inspect, and measured behavior on the target host.
Reference routing
| Load when | Reference |
| Starting a project or choosing primitives | references/01-model-and-file-design.md |
| Dependencies, healthchecks, shutdown, or jobs | references/02-lifecycle-and-health.md |
| DNS, ports, networks, volumes, or persistence | references/03-networking-and-storage.md |
.env, interpolation, profiles, or overrides | references/04-configuration-and-overrides.md |
| Watch, builds, CI, or production operations | references/05-development-and-production.md |
| Secrets, least privilege, or supply-chain concerns | references/06-security.md |
| A failure needs a systematic workflow | references/07-troubleshooting.md |
| CLI command or field lookup | references/08-command-playbook.md |
| Source coverage and freshness checks | references/00-source-index.md |
Included artifacts
templates/: portable base, development, production, environment, and secret-file examples.assets/project-review-checklist.md: handoff and pre-deployment review checklist.scripts/compose-doctor.sh: deterministic validation and runtime diagnostics with text or JSON output.
Failure boundaries
config --quietproves model resolution, not image pulls, startup, or application correctness.- A running container is not a ready service. A passing healthcheck is not end-to-end verification.
docker compose downremoves project containers and networks; it normally preserves named volumes.down -vis destructive.
When not to use this skill
Use an orchestrator-specific skill for Kubernetes, Swarm scheduling, or another platform's deployment controller. Compose can describe some deploy concepts, but is not a substitute for that platform's operational API.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

