Developer and Text Tools

Visualising a Docker Compose Stack and Catching Risky Settings

Turn compose.yaml into a diagram of services, networks and volumes, understand depends_on and healthchecks, and fix exposed ports and plain-text secrets.

Saizul Amin
Saizul Amin3 Nov 2026 · 3 min read
Visualising a Docker Compose Stack and Catching Risky Settings

A compose file is the easiest way to run a multi-container application, and also one of the easiest places to leave a database open to the internet. As stacks grow, the YAML stops telling the story at a glance. The Docker Compose Visualizer turns the file into a diagram and runs checks for the settings that cause trouble in production.

What the diagram shows

Each service is a card with its image or build context, published ports, networks and number of mounts. Cards are arranged in columns by startup order. Services with no dependencies sit on the right and start first; each column to the left depends on the ones to its right. Arrows show dependencies, and their style shows what kind of wait they mean.

Named volumes appear on the far right with dotted lines to the services that mount them, and network chips are colour-coded so you can see which services can reach each other. Export the diagram as SVG for documentation or PNG for a chat message.

depends_on and healthchecks

A plain depends_on entry only waits for the dependency's container to start. A database container starts long before it accepts connections, which is why apps crash on first boot and work on the second try. The fix is a healthcheck on the database and a dependency condition of service_healthy on the app. The diagram draws these as solid green arrows and plain dependencies as dashed grey ones.

If a service waits for a healthy dependency that has no healthcheck, Compose refuses to start. The checker reports this as an error before you find out at deploy time.

Published ports and the firewall

A ports entry like 5432:5432 listens on every network interface of the host. On Linux, Docker writes its own firewall rules, and those rules are evaluated before many host firewall tools such as ufw, so the port can be reachable from the internet even when you believe it is blocked.

The checker raises a warning for well-known database and cache ports published this way and suggests two fixes: bind to localhost with 127.0.0.1:5432:5432, or remove the ports entry entirely and let other services reach the database over the internal network. Other published ports get a lighter notice so you can confirm each one is intended.

Secrets in the file

Environment variables with names like PASSWORD, SECRET, TOKEN or API_KEY and a literal value are flagged. A compose file usually lives in git, so the value lives in git history too. Use variable substitution with values from an untracked env file, or Compose secrets, which mount values as files.

Other checks

  • Images without a tag or with latest, which can change under you.
  • Privileged containers and mounts of the Docker socket, both close to root on the host.
  • Named volumes and networks used but not declared.
  • Two services publishing the same host port.
  • Dependency cycles, which Compose cannot start.
  • Services without a restart policy, and the obsolete version key.

A worked example

A five-service stack with a reverse proxy, a web app, a background worker, PostgreSQL and Redis gives a three-column diagram: the database and cache start first, the web app and worker next, and the proxy last. The checker finds three warnings: the database port published on every interface, Redis without a version tag and a session secret written in the file. It also notes that the worker only waits for the database container to start. Each has a one-line fix.

A clean-up routine

  1. Paste the file and look at the diagram for anything unexpected.
  2. Fix errors first: missing references, cycles and health conditions.
  3. Bind or remove database ports.
  4. Move secrets out of the file.
  5. Pin image versions.
  6. Export the diagram for the project README.

Limits

The visualizer reads one file as written. Variable substitution, extends, include, profiles and override files are not merged, so for complex projects paste the output of docker compose config. It does not contact Docker or check that containers really start.

Completely freeNo cost, no sign-up
Files stay privateEverything runs in your browser
Easy in your languageAvailable in many languages