Creating block diagrams from docker-compose files
krishna
Posted on March 22, 2020
A docker-compose file contains the definition of all the services that needs to run in harmony to successfully deploy an app stack.
When services and their interactions are defined clearly in a compose file manually charting a block diagram to list those services and their interaction is redundant, isn't it ? that was the thought I had when I needed to chart a block diagram for documenting my architecture.
A quick search using "tool to convert a docker compose file to a block diagram" yielded this awesome repo https://github.com/pmsipilot/docker-compose-viz
The code in this repo will help us to chart a block diagram from a docker compose file.
Lets create one!
-
Sample docker-compose of a simple SaaS stack
-
Command to execute
docker run --rm -it \ --name dcv \ -v /home/user/blog:/input pmsipilot/docker-compose-viz \ render -m image \ --force docker-compose.yml \ --output-file=topology.png \ --no-volumes \ --no-ports \ --no-networks
Ouptput
- Command - With port numbers
docker run --rm -it \ --name dcv \ -v /home/user/blog:/input pmsipilot/docker-compose-viz \ render -m image \ --force docker-compose.yml \ --output-file=topology.png \ --no-volumes \ --no-networks
docker run --rm -it \ --name dcv \ -v /home/user/blog:/input pmsipilot/docker-compose-viz \ render -m image \ --force docker-compose.yml \ --output-file=topology.png \ --no-ports \ --no-networks
- Ouptput - with volumes
Posted on March 22, 2020
Join Our Newsletter. No Spam, Only the good stuff.
Sign up to receive the latest update from our blog.