Skip to content

jeremylongshore/tons-of-skills-marketplace / plugins/devops/docker-compose-generator/skills/generating-docker-compose-files

generating-docker-compose-files

Verified

Execute use when you need to work with Docker Compose. This skill provides Docker Compose file generation with comprehensive guidance and automation. Trigger with phrases like "generate docker-compose", "create compose file", or "configure multi-container app".

FileKindSize
SKILL.mdskill md4.3 KB
assets/README.mdmarkdown305 B
assets/compose_template.ymlconfig3.3 KB
assets/example_app_architectures.mdmarkdown6.7 KB
references/README.mdmarkdown67 B
scripts/README.mdmarkdown382 B
scripts/deploy.shexecutablescript11.3 KB
scripts/generate_env_file.pyexecutablescript11.1 KB
scripts/validate_compose.shexecutablescript7.2 KB
---
name: generating-docker-compose-files
description: 'Execute use when you need to work with Docker Compose.

  This skill provides Docker Compose file generation with comprehensive guidance and
  automation.

  Trigger with phrases like "generate docker-compose", "create compose file",

  or "configure multi-container app".

  '
allowed-tools: Read, Write, Edit, Grep, Glob, Bash(docker:*), Bash(kubectl:*)
version: 1.28.0
author: Jeremy Longshore <jeremy@intentsolutions.io>
license: MIT
tags:
- devops
- docker
- docker-compose
compatibility: Designed for Claude Code
---
# Generating Docker Compose Files

## Overview

Generate production-ready `docker-compose.yml` files for multi-container applications. Define services, networks, volumes, health checks, resource limits, and environment-specific overrides for local development, testing, and single-host production deployments.

## Prerequisites

- Docker Engine 20.10+ and Docker Compose v2 (`docker compose version`)
- Application Dockerfiles for each service or pre-built images available
- Understanding of service dependencies and inter-service communication ports
- Environment variable values or `.env` files for configuration
- Sufficient disk space and memory for all containers defined in the stack

## Instructions

1. Scan the project for existing Dockerfiles, `docker-compose*.yml` files, and application entry points
2. Identify all services that compose the application stack (web server, API, database, cache, message queue, worker)
3. Define each service with image or build context, port mappings, and environment variables
4. Configure service dependencies using `depends_on` with health check conditions to ensure proper startup order
5. Create named volumes for persistent data (database files, uploads, cache) and bind mounts for development hot-reload
6. Define custom bridge networks to isolate service groups (frontend, backend, data tier)
7. Add health checks for each service to enable dependency-aware startup and container orchestrator integration
8. Set resource limits (`deploy.resources.limits`) for CPU and memory to prevent a single container from exhausting the host
9. Create environment-specific override files: `docker-compose.override.yml` for development, `docker-compose.prod.yml` for production
10. Validate the configuration with `docker compose config` to check for syntax errors

## Output

- `docker-compose.yml` with service definitions, networks, and volumes
- Environment-specific override files (`docker-compose.override.yml`, `docker-compose.prod.yml`)
- `.env` file template with documented variables
- Dockerfiles for services that require custom builds
- Helper scripts for common operations (`start.sh`, `stop.sh`, `logs.sh`)

## Error Handling

| Error | Cause | Solution |
|-------|-------|---------|
| `port is already allocated` | Another container or host process using the same port | Change the host port mapping or stop the conflicting process |
| `network not found` | Referenced network not defined in the compose file | Add the network under the top-level `networks:` key |
| `service depends on undefined service` | Typo in `depends_on` or missing service definition | Verify service names match exactly between `depends_on` and service definitions |
| `volume mount permission denied` | Host directory owned by different user than container process | Use `user:` directive in service or set proper ownership with an init script |
| `OOM killed` | Container exceeded memory limit | Increase `deploy.resources.limits.memory` or optimize application memory usage |

## Examples

- "Generate a docker-compose.yml for a Node.js API + PostgreSQL + Redis stack with health checks, named volumes, and a development override with hot-reload."
- "Create a compose file for a WordPress site with MySQL, Nginx reverse proxy, and Certbot for automatic SSL certificate renewal."
- "Build a docker-compose stack for a microservices app with 3 APIs, RabbitMQ message broker, and a shared Postgres database with isolated networks."

## Resources

- Docker Compose specification: https://docs.docker.com/compose/compose-file/
- Docker Compose best practices: https://docs.docker.com/compose/production/
- Compose file versioning: https://docs.docker.com/compose/compose-file/compose-versioning/
- Multi-environment guide: https://docs.docker.com/compose/extends/
writing-skillsobra/superpowersUse when creating new skills, editing existing skills, or verifying skills work before deploymentStars: 323kUpdated Claude CodeCodexVerifiedInstall
xlsxanthropics/skillsUse this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing .xlsx, .xlsm, .xltx, .csv, or .tsv file (e.g., adding columns, computing formulas, formatting, charting, cleaning messy data); create a new spreadsheet from scratch or from other data sources; or convert between tabular file formats. Trigger especially when the user references a spreadsheet file by name or path — even casually (like "the xlsx in my downloads") — and wants something done to it or produced from it. Also trigger for cleaning or restructuring messy tabular data files (malformed rows, misplaced headers, junk data) into proper spreadsheets. The deliverable must be a spreadsheet file. Do NOT trigger when the primary deliverable is a Word document, HTML report, standalone Python script, database pipeline, or Google Sheets API integration, even if tabular data is involved.Stars: 198kUpdated Claude CodeCodexVerifiedInstall
shipping-and-launchaddyosmani/agent-skillsPrepares production launches. Use when preparing to deploy to production, or when asking what needs to be in place before shipping. Use when you need a pre-launch checklist, when setting up monitoring, when planning a staged rollout, or when you need a rollback strategy.Stars: 119kUpdated Claude CodeCodexVerifiedInstall
childhoodthedotmack/claude-memBabysit a shipped release after merge, publication, or deployment. Verify published packages, production behavior, installed plugins, and late CI or user reports until the observation window is clean; use babysit for PR readiness before release.Stars: 118kUpdated Claude CodeCodexVerifiedInstall