Write a Docker Compose dev environment
Writes a Docker Compose local development setup that mirrors production dependencies, with health checks, named volumes, seed data, env files and a one-command start. Use when onboarding developers.
A local environment earns its keep when a new developer can clone the repo, run one command and have a working app with realistic data in minutes, and when "works on my machine" bugs stop coming from version drift. Compose files usually fall short in the same ways: latest images that differ from production, apps that start before the database accepts connections, data lost on every restart, secrets committed in the file, ports exposed on every network interface, and no seed data, so everyone builds their own by hand.
Write a Docker Compose development environment for: Only if [STACK] is given:
Stack: Only if [PRODUCTION_NOTES] is given:
Production:
- If the repository is available, read the existing Dockerfiles, dependency manifests, environment variable usage and any current compose file first, and build on them.
- Pin every dependency image to the same major and minor version as production (for example
postgres:16.4), neverlatest. Where production uses a managed service with no local equivalent, choose a compatible local stand-in and record the gap. - Write
compose.yamlfollowing the current Compose Specification (no top-levelversion:key):
- App services built from the repo's Dockerfile, using a development target or stage if one exists, with the source bind-mounted for hot reload (or a
develop.watchsection), and dependency folders kept inside the container so host and container builds do not clash. - A
healthcheckon every dependency using its own readiness command (pg_isready,redis-cli ping, an HTTP health endpoint), anddepends_onwithcondition: service_healthyon the app services. - Named volumes for all persistent data; no anonymous volumes for data that should survive a restart.
- Ports published on
127.0.0.1only, with defaults that avoid common clashes and can be overridden from the env file. - Optional services (admin UIs, observability, workers that are not always needed) behind
profiles.
- Put configuration in an env file: write
.env.examplewith every variable, safe local defaults and a comment per variable; the real.envstays git-ignored. Never put production credentials or real secrets anywhere. - Provide seed data: database init scripts or a one-shot seed service that runs after the database is healthy (
condition: service_completed_successfullyfor services that depend on it), is idempotent, and creates a few realistic, clearly fake records, including a known login for local use. - Give the one-command start (
docker compose up --waitor amake dev/ script wrapper), plus reset, logs, shell and test commands. - List every remaining difference from production and its consequence, and a short troubleshooting section (port in use, CPU architecture mismatches on ARM machines, stale volumes, file-watching on mounted folders).
If a service's build or start command is unknown and the repository is not available, ask for it rather than inventing one.
- Every image is pinned. Every dependency has a health check. Every data store has a named volume.
- No secrets, tokens or real personal data in any file. Local passwords are obviously local (for example
localdev). - Do not add services that were not asked for, except a local stand-in for a dependency that has none; say why each was added.
- Keep it runnable on macOS, Linux and Windows with WSL; call out anything that is not.
- Before saying the work is done, run the check that proves it (tests, build, type check or the command the user gave) and report the real result.
- If you could not run a check, say so plainly and say which one.
Assumptions
Bullets, only those that shaped the setup.
compose.yaml
One yaml code block, with short comments on non-obvious lines.
.env.example
One code block.
Seed data
The seed scripts or seed service, and what records they create.
Commands
A table: task | command. Include start, stop, reset data, logs, shell, run tests.
Differences from production
Table: area | production | local | consequence.
Troubleshooting
Short bullets: symptom, then fix.
1 required value still a placeholder; the assistant will ask for it.
details
- kind
- Prompt: a task you run by name to get one finished thing back
- domain
- Software engineering
- category
- DevOps
- level
- Intermediate
- made for
- Software engineer, Backend engineer, DevOps / platform engineer, Full-stack engineer
- needs
- repo-read, file-write
- risk
- edits-files
- version
- v1.0.0 · experimental
- reviewed
- 2026-10-02
- works in
- Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, Antigravity, OpenCode, Windsurf, Zed, Continue, AGENTS.md
use in
npx @hermes-hq/hodios install write-docker-compose --target claude-codenpx skills add hermes-hq/hodios-dist --skill write-docker-compose -a claude-codeclaude plugin marketplace add hermes-hq/hodios-distclaude plugin install hodios-software-engineering@hodiosThe plugin brings every entry in this domain at once.
pairs well with
All of DevOpsReview a Dockerfile
Reviews a Dockerfile for security, image size, build cache use and runtime correctness, and returns ranked findings with a corrected file. Use before shipping a new or changed container image.
review-dockerfileGenerate realistic seed data
Generates realistic, referentially consistent fixture data for a database schema, with labelled edge cases and no real personal data. Use for local development, demos and integration tests.
generate-realistic-seed-dataWrite a developer onboarding guide
Writes an onboarding guide for a repository covering setup, an architecture map, first tasks and known gotchas, with every command checked against the repo. Use for new hires or contributors.
write-onboarding-guideDevOps engineer
Acts as a DevOps engineer who automates the second time, keeps pipelines fast and reproducible, and makes every change reversible. Use for CI/CD, infrastructure and release work.
devops-engineerDesign a deployment strategy
Chooses and specifies a deployment strategy (rolling, blue-green, canary or feature-flagged) with health gates, automated rollback triggers and database-change ordering. Use when deploys feel risky.
design-deployment-strategyReview an infrastructure plan before apply
Reviews a Terraform, OpenTofu or other IaC plan for destructive changes, security exposure, cost surprises and changes outside the stated intent. Use before running apply, especially in production.
review-iac-plan