Convert docker-compose.yml into an architecture diagram.
A Compose file is a complete description of a small system written in a format that hides its shape.
What maps cleanly
Services become components. Images identify tiers by recognisable name, so postgres and redis land in data while nginx lands at the edge. Published ports mark what is externally reachable and named volumes mark what holds state, which is the distinction most worth having when someone is deciding what can be restarted.
The edges are partly inferred
depends_on gives explicit edges and is usually incomplete, because it only controls startup ordering and many teams stop maintaining it. The more informative edges come from environment variables where one service names another's address, and from shared network membership. Those inferred edges are the ones worth checking.
Best used for onboarding
A Compose file is the first thing a new engineer runs and among the last they understand. Putting the generated diagram in the README turns a file people copy commands from into an explanation of what they just started.
Fidelity
| Comes through | Does not | |
|---|---|---|
| services | One component each | |
| depends_on | Explicit edges | Often incomplete in practice |
| ports | Marks external reachability | |
| volumes | Marks stateful, data tier | |
| networks | Reachability grouping | |
| environment references | Inferred edges | Worth verifying |
| healthcheck | As a note | |
| Production topology | Compose describes local, not production |
The prompt
Questions
Related
- Convert Code to a DiagramThe general case: point it at code and get a diagram of what is there rather than what you remember building.
- Convert a Diagram into CodeThe direction almost nothing else does: the diagram stops being documentation and becomes the instruction.
- Convert Terraform to an Architecture DiagramTerraform records dependencies explicitly through references, so the edges are read rather than inferred. It is one of the most reliable sources there is.
- Convert Mermaid to ExcalidrawUseful when a Mermaid diagram has outgrown what Mermaid's layout can render legibly.