Generate an architecture diagram from docker-compose.yml.
A Compose file is already a complete description of a small system. It is just written in a format that hides the shape.
What it reads
The services block, which is the component list; depends_on, which gives explicit ordering edges; ports, which identifies what is reachable from outside; volumes, which identifies what holds state; networks, which shows what can reach what; and environment variables, which are usually where one service's address appears inside another and are therefore where the real edges hide.
How Compose becomes components
Each service is a component. Images map to tiers by recognisable name: postgres, mysql, mongo and redis go to data, nginx and traefik go to edge, and anything with a build context is application. Published ports put a component at the edge of the diagram, and a named volume marks a service as stateful, which is the distinction that matters most when someone is deciding what can be restarted safely.
Why the layout can be trusted
The agent reads the files listed above and emits a semantic graph: components, the tier each belongs to, and the edges between them, with no coordinates anywhere. The ELK layout engine then computes positions and orthogonal edge routing. This is why the output cannot come back with boxes overlapping or arrows crossing through cards, which is the usual failure when a language model is asked to place things on a canvas itself.
Useful mainly for onboarding
A Compose file is the first thing a new engineer runs and among the last things they understand. Turning it into a picture on day one, and keeping that picture in the README, converts a file people copy commands out of into an explanation of what they just started.
Your Compose file stays on your machine
It runs on your machine. With a local Ollama model nothing leaves the laptop at all, and with your own API key the file contents go to the provider you chose and never through us. For a source that is your actual codebase, that distinction is usually the deciding one.
Compose to diagram
| In the file | In the diagram |
|---|---|
| services entries | One component each |
| depends_on | Explicit ordering edges |
| ports | Marks a component as externally reachable |
| volumes | Marks a component as stateful, data tier |
| networks | Which components can reach which |
| environment referencing another service | An inferred edge |
| image: postgres, redis, mongo | Data tier |
| image: nginx, traefik, caddy | Edge tier |
| build: | Application tier, your own code |
The prompt
Questions
Related
- Generate a Diagram from a CodebasePoint it at a repository and it surveys the code the way a new engineer would, then draws what it found.
- Generate a Diagram from TerraformTerraform already describes your infrastructure precisely. The diagram is a rendering of something you have written down, not a guess.
- Generate a Diagram from Kubernetes ManifestsKubernetes YAML contains the whole topology and presents it as several hundred lines in which none of it is visible.
- Generate a Diagram from a GitHub RepoClone it and point the app at the directory. Private repositories work exactly the same way, because nothing is uploaded to make it work.