Docker Compose to Mermaid diagram
Paste Compose YAML and get a Mermaid architecture diagram for README files, reviews, and documentation.
About this tool
Convert a docker-compose.yml or compose.yaml file into Mermaid flowchart text.
The parser reads the parts that describe architecture — services, image or
build, depends_on, links, network_mode: service:..., ports, volumes,
networks, profiles, restart policy, and replica counts — and ignores runtime
details such as commands and environment values.
Use raw Mermaid output for Mermaid Live, GitHub Markdown, Notion, and IDE preview plugins. Use Markdown output when you want a ready-to-paste fenced code block. Use Summary output for a text audit of services, dependencies, duplicate host ports, unused declarations, and circular dependency chains.
Worked example:
- Paste a Compose file with
web,api, anddbservices. - Set direction to
LRfor a left-to-right architecture view. - Leave networks as subgraphs and keep ports/volumes enabled.
- Copy the Mermaid flowchart into your README or diagram previewer.
Limits and edge cases: this tool accepts YAML up to 2 MB and up to 500 services.
It does not run Docker, pull images, read .env, resolve includes, or inspect
external compose files referenced by extends.file; those references are reported
as warnings in the summary.
FAQ
Does this execute my Compose file?
No. The tool only parses YAML text and renders a diagram. It does not contact
Docker, fetch images, interpolate .env, or run any service commands.
Which dependency forms are shown?
Both depends_on: [db] and the long map form with condition: are supported.
The tool also draws links, network_mode: service:name, and same-file
extends relationships so hidden service coupling is visible.
How should I show shared networks?
Use subgraph for the common case where each service mostly belongs to one
network. Use node when services join many networks and you want every network
drawn as a separate node. Use off for a dependency-only diagram.
Can I use the output directly in a README?
Yes. Choose markdown output for a ready-to-paste fenced mermaid block, or
choose raw mermaid output if your documentation system already provides the
fence.
Developer & Automation Access
Run it from the terminal
Same engine as this page, headless — via the gizza CLI:
gizza tool compose-to-diagram "services:
web:
image: nginx
depends_on:
- api"New to the CLI? Get gizza →
Open it by URL
Pre-fill and auto-run this tool with query parameters — the names match the API/CLI:
https://gizza.ai/tools/compose-to-diagram/?compose=services%3A%0A%20%20web%3A%0A%20%20%20%20image%3A%20nginx%0A%20%20%20%20depends_on%3A%0A%20%20%20%20%20%20-%20api&direction=TD&networks=subgraph&ports=true&volumes=true&labels=image&profile=debug&styled=true&title=Checkout%20stack&output=mermaidMachine-readable descriptor: tool.json — title + parameters JSON Schema for agents.
