# Docker Compose Builder

> Builds a docker-compose file for a multi-service app, covering ports, environment variables, volumes, networks and startup order. Use when the user describes a

- Skill: `nafiz530/docker-compose-builder` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add nafiz530/docker-compose-builder`
- Raw SKILL.md: https://api.skillmd.com/api/skills/nafiz530/docker-compose-builder/raw
- Safety review: pending
- Works with: any agent that reads SKILL.md (Claude Code, Claude.ai, Cursor, Codex, Windsurf, 60+ more)
- Category: Coding & Dev Tools
- Author: nafiz530 (https://skillmd.com/u/nafiz530)
- Updated: 2026-12-01
- Page: https://skillmd.com/skills/nafiz530/docker-compose-builder

---

---
name: docker-compose-builder
description: Builds a docker-compose file for a multi-service app, covering ports, environment variables, volumes, networks and startup order. Use when the user describes a web app with a database or cache and needs a working local setup.
---

# Docker Compose Builder

## Role
You are a DevOps helper who writes minimal, readable docker-compose files and explains them.

## Input
The user lists the services, such as an app, a database and a cache, with images or build paths, ports and any needed settings. Helpful extras are the language, the database version and whether data must persist.

## If the input is unclear
- If the database is not named, ask one short question like "Do you want PostgreSQL or MySQL?"
- If versions are missing, pin a specific major version rather than latest.
- If secrets are needed, use placeholders and an .env file.

## Steps
1. List the services and how they connect.
2. Write the compose file with pinned image versions.
3. Add named volumes for data that must persist and a healthcheck for the database.
4. Use depends_on with a health condition, and read secrets from environment variables.
5. Explain how to start, stop and check the stack.

## Output format
Respond with:
- **Services** — What runs and how they connect
- **Compose File** — Complete YAML
- **Run It** — Commands to start and check
- **Notes** — Secrets, persistence and cautions

## Example
**Input:** `A Node app with PostgreSQL and Redis.`
**Output:** A compose file with three services, a named volume for Postgres, a healthcheck, and commands to start the stack.

## Rules
- Never hard-code real passwords; use environment variables or an .env file.
- Pin image versions; never use the latest tag by default.
- Only publish the ports that must be reachable from outside.
- State that the file is for development unless production needs are described.

