generating-docker-compose-files
БесплатноЗапускает вложенные скриптыНе проверенExecute use when you need to work with Docker Compose. This skill provides Docker Compose file generation with comprehensive guidance and automation. Trigger…
от jeremylongshore★ 2 961 звезда на GitHubОб этом скилле
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
.envfiles for configuration - Sufficient disk space and memory for all containers defined in the stack
Instructions
- Scan the project for existing Dockerfiles,
docker-compose*.ymlfiles, and application entry points - Identify all services that compose the application stack (web server, API, database, cache, message queue, worker)
- Define each service with image or build context, port mappings, and environment variables
- Configure service dependencies using
depends_onwith health check conditions to ensure proper startup order - Create named volumes for persistent data (database files, uploads, cache) and bind mounts for development hot-reload
- Define custom bridge networks to isolate service groups (frontend, backend, data tier)
- Add health checks for each service to enable dependency-aware startup and container orchestrator integration
- Set resource limits (
deploy.resources.limits) for CPU and memory to prevent a single container from exhausting the host - Create environment-specific override files:
docker-compose.override.ymlfor development,docker-compose.prod.ymlfor production - Validate the configuration with
docker compose configto check for syntax errors
Output
docker-compose.ymlwith service definitions, networks, and volumes- Environment-specific override files (
docker-compose.override.yml,docker-compose.prod.yml) .envfile 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/
Установить generating-docker-compose-files в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditGrepGlobBash(docker:*)Bash(kubectl:*)Вложенные файлы
FAQ
Что делает скилл generating-docker-compose-files?
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".
Как установить скилл generating-docker-compose-files?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл generating-docker-compose-files запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
ci-review
The scan that the plugin's GitHub Action runs.
от Anthropicazure-static-web-apps
Helps create, configure, and deploy Azure Static Web Apps using the SWA CLI. Use when deploying static sites to Azure, setting up SWA local development…
от GitHubai-ready
Make any repo AI-ready — analyzes your codebase and generates AGENTS.md, copilot-instructions.md, CI workflows, issue templates, and more. Mines your PR…
от GitHubaws-cdk-python-setup
Setup and initialization guide for developing AWS CDK (Cloud Development Kit) applications in Python. This skill enables users to configure environment…
от GitHub