Docker Compose Generator
Skill9 starsChanged 8 months agoMITView on GitHub
Generates production-ready docker-compose.yml files for any application stack.
- Reads credentials
In this repository61 other files it gives its agents.
- Accessibility Audit HelperSkill
- Agent Context File WriterSkill
- Agent Evaluation Framework BuilderSkill
- AI Feature Spec WriterSkill
- API Documentation GeneratorSkill
- REST API Endpoint DesignerSkill
- Architecture ExplainerSkill
- Article RepurposerSkill
- Auth Flow PlannerSkill
- Blog Outline GeneratorSkill
- Breaking Change DetectorSkill
- Bug Root Cause AnalyzerSkill
- Caching Strategy AdvisorSkill
- Changelog CuratorSkill
- Code Review ChecklistSkill
- Database Schema ReviewerSkill
- Documentation Gap FinderSkill
- Edge Case DiscoverySkill
- Error Log SummarizerSkill
- FAQ GeneratorSkill
- Flaky Test AnalyzerSkill
- Form UX OptimizerSkill
- Git Commit WriterSkill
- Hallucination Risk ReviewerSkill
- Hybrid Search ArchitectSkill
- Incident Postmortem WriterSkill
- Issue to PR PlannerSkill
- Landing Page Copy ImproverSkill
- LangGraph State Machine DesignerSkill
- LLM Cost OptimizerSkill
- LLM Tracing and Observability SetupSkill
- MCP Integration AssistantSkill
- MCP Server BuilderSkill
- Migration Guide WriterSkill
- Newsletter Summary WriterSkill
- Observability ChecklistSkill
- Playwright Test BuilderSkill
- PR Description WriterSkill
- Prompt Injection Defense AuditorSkill
- Prompt RefinerSkill
- Prompt Version Control WorkflowSkill
- RAG Chunking Strategy AdvisorSkill
- RAG Workflow PlannerSkill
- React Component ReviewerSkill
- README WriterSkill
- Refactor PlannerSkill
- Release Notes GeneratorSkill
- Responsive Layout ReviewerSkill
- SDK Quickstart WriterSkill
- SEO Content OptimizerSkill
- SEO Metadata GeneratorSkill
- Social Post Thread WriterSkill
- Sprint Summary GeneratorSkill
- SQL Query OptimizerSkill
- Stack Trace AnalyzerSkill
- Technical Blog Post WriterSkill
- Tech Debt AuditorSkill
- Troubleshooting Guide BuilderSkill
- Unit Test ImproverSkill
- Unit Test WriterSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
14 rules. About 0 are common, 5 are distinctive, and 9 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈5
Distinctive · estimate
This author's own choices. Worth a look.
9
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 19
Use this when bootstrapping a new project, when converting an existing app to run in containers, or when you want a solid starting point to …
- Very specific: line 39
When asked to generate a docker-compose.yml, follow these steps:
- Distinctive: line 41
Gather requirements: If not already provided, ask for:
- Very specific: line 49
Always set a restart policy (unless-stopped for production, on-failure for dev)
- Very specific: line 50
Add a healthcheck for every database or cache service
- Distinctive: line 51
Use named volumes (not bind mounts) for persistent data in production
- Distinctive: line 52
Use a custom named network — do not rely on the default bridge network
- Very specific: line 53
Put secrets and credentials in environment variables with ${VAR_NAME} placeholders, never hardcoded values
- Very specific: line 57
Add bind-mount source code for hot reloading (e.g., ./src:/app/src)
- Very specific: line 59
Add a .env.example reminder comment
- Very specific: line 62
Add deploy.resources.limits for memory and CPU
- Distinctive: line 63
Do not expose database ports to the host unless explicitly requested
- Very specific: line 64
Use read_only: true on containers where the filesystem does not need to be writable
- Very specific: line 164
Always rotate any credentials in .env.example before using them in a real environment.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Docker Compose Generator
What this skill does
This skill directs the agent to gather information about your application stack and produce a production-ready docker-compose.yml file. It includes health checks, named volumes, custom networks, environment variable placeholders, restart policies, and sensible resource limits — all things that are easy to miss when writing a Compose file from scratch.
Use this when bootstrapping a new project, when converting an existing app to run in containers, or when you want a solid starting point to customize from.
How to use
Claude Code / Cline
Copy this file to .agents/skills/docker-compose-generator/SKILL.md in your project root.
Then ask:
- "Use the Docker Compose Generator skill to create a docker-compose.yml for my Node.js app with PostgreSQL and Redis."
- "I have a Python FastAPI backend, a React frontend, and a Postgres database. Use the Docker Compose Generator skill."
The agent will ask clarifying questions before generating the file if your description is incomplete.
Cursor / Codex
Paste the instructions from the section below into your session along with a description of your stack.
The Prompt / Instructions for the Agent
When asked to generate a docker-compose.yml, follow these steps:
- Gather requirements. If not already provided, ask for:
- The application services (e.g., web server, worker, frontend build)
- The data stores (PostgreSQL, MySQL, MongoDB, Redis, etc.) and their versions
- The runtime environment (Node.js, Python, Go, etc.) and version
- Whether this is for development or production (they differ significantly)
- Any custom ports, domains, or volume paths
- Apply these rules to every service:
- Always set a
restartpolicy (unless-stoppedfor production,on-failurefor dev) - Add a
healthcheckfor every database or cache service - Use named volumes (not bind mounts) for persistent data in production
- Use a custom named network — do not rely on the default bridge network
- Put secrets and credentials in environment variables with
${VAR_NAME}placeholders, never hardcoded values - Set
depends_onwithcondition: service_healthyfor services that require a healthy DB before starting
- Always set a
- For development configs, also:
- Add bind-mount source code for hot reloading (e.g.,
./src:/app/src) - Expose debug ports (e.g.,
9229for Node.js inspector) - Add a
.env.examplereminder comment
- Add bind-mount source code for hot reloading (e.g.,
- For production configs, also:
- Add
deploy.resources.limitsfor memory and CPU - Do not expose database ports to the host unless explicitly requested
- Use
read_only: trueon containers where the filesystem does not need to be writable
- Add
- Output:
- The
docker-compose.ymlin a fenced code block - A
.env.examplesnippet showing all required variables - A brief "Next steps" section (e.g., how to start, how to view logs)
- The
Example
Input to Agent:
"Use the Docker Compose Generator skill. I have a Node.js Express API (port 3000), a PostgreSQL 16 database, and a Redis 7 cache. This is for production."
Output from Agent:
# docker-compose.yml
version: '3.9'
services:
api:
build: .
restart: unless-stopped
ports:
- "3000:3000"
environment:
- DATABASE_URL=${DATABASE_URL}
- REDIS_URL=${REDIS_URL}
- NODE_ENV=production
depends_on:
postgres:
condition: service_healthy
redis:
condition: service_healthy
networks:
- app-network
deploy:
resources:
limits:
cpus: '1.0'
memory: 512M
postgres:
image: postgres:16-alpine
restart: unless-stopped
environment:
- POSTGRES_DB=${POSTGRES_DB}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
volumes:
- postgres-data:/var/lib/postgresql/data
networks:
- app-network
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}"]
interval: 10s
timeout: 5s
retries: 5
redis:
image: redis:7-alpine
restart: unless-stopped
command: redis-server --appendonly yes
volumes:
- redis-data:/data
networks:
- app-network
healthcheck:
test: ["CMD", "redis-cli", "ping"]
interval: 10s
timeout: 5s
retries: 5
volumes:
postgres-data:
redis-data:
networks:
app-network:
driver: bridge.env.example
DATABASE_URL=postgresql://user:password@postgres:5432/myapp
REDIS_URL=redis://redis:6379
POSTGRES_DB=myapp
POSTGRES_USER=user
POSTGRES_PASSWORD=changemeNext steps
- Copy
.env.exampleto.envand fill in real values docker compose up -dto start all servicesdocker compose logs -f apito tail API logs
Notes
- The generated file is a starting point — review resource limits and port exposure before deploying.
- The skill does not write a
Dockerfilefor your application image. It assumes yourDockerfilealready exists in the project root, or will ask you to create one. - For multi-environment setups, consider generating separate
docker-compose.override.ymlfiles for dev and staging. Ask the agent to do this explicitly. - Always rotate any credentials in
.env.examplebefore using them in a real environment.
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.

