Skip to content
TopicTracker
From HackerNewsView original
TranslationTranslation

Show HN: Run multiple Docker Compose instances for your agents

Docktree is a CLI tool that dynamically generates Docker Compose overrides to avoid host port, container name, and volume collisions when running multiple agents or git worktrees. It auto-allocates ports, isolates networks and volumes, and rewrites container names without modifying compose files.

Background

- **Docker Compose** lets you run multi-container apps (e.g., web app + database) via a YAML config. Running multiple copies of the same stack simultaneously — say, different Git branches — causes conflicts because containers fight over the same port numbers, network names, and volume paths. - **Git worktrees** allow checking out multiple branches side-by-side in separate directories. Developers and AI coding agents use them to run different versions of an app at once, which collides with Docker Compose's default behavior. - **Docktree** is a new open-source CLI tool that auto-generates Compose overrides to avoid collisions: unique ports, isolated networks/volumes, rewritten container names — no edits to your compose files required. It includes a built-in reverse proxy (routes `mybranch.localhost`) and tunnel sharing via Cloudflare/ngrok, letting AI agents spin up and share previews of their work.

Related stories