{"id":13584726,"url":"https://github.com/pmsipilot/docker-compose-viz","last_synced_at":"2025-05-15T02:08:20.891Z","repository":{"id":44674650,"uuid":"65026022","full_name":"pmsipilot/docker-compose-viz","owner":"pmsipilot","description":"Docker compose graph visualization","archived":false,"fork":false,"pushed_at":"2024-11-06T18:20:18.000Z","size":406,"stargazers_count":918,"open_issues_count":15,"forks_count":68,"subscribers_count":19,"default_branch":"master","last_synced_at":"2025-04-14T00:58:25.023Z","etag":null,"topics":["docker","graphviz"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pmsipilot.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-08-05T14:42:45.000Z","updated_at":"2025-04-01T04:27:02.000Z","dependencies_parsed_at":"2024-11-29T11:11:52.752Z","dependency_job_id":"e4c53aab-8e2f-48b1-9a6c-5a00a017aa29","html_url":"https://github.com/pmsipilot/docker-compose-viz","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmsipilot%2Fdocker-compose-viz","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmsipilot%2Fdocker-compose-viz/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmsipilot%2Fdocker-compose-viz/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pmsipilot%2Fdocker-compose-viz/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pmsipilot","download_url":"https://codeload.github.com/pmsipilot/docker-compose-viz/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254259384,"owners_count":22040820,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["docker","graphviz"],"created_at":"2024-08-01T15:04:28.715Z","updated_at":"2025-05-15T02:08:20.823Z","avatar_url":"https://github.com/pmsipilot.png","language":"PHP","funding_links":[],"categories":["PHP"],"sub_categories":[],"readme":"# `docker-compose-viz`\n\n[![Average time to resolve an issue](http://isitmaintained.com/badge/resolution/pmsipilot/docker-compose-viz.svg)](http://isitmaintained.com/project/pmsipilot/docker-compose-viz \"Average time to resolve an issue\")\n[![Percentage of issues still open](http://isitmaintained.com/badge/open/pmsipilot/docker-compose-viz.svg)](http://isitmaintained.com/project/pmsipilot/docker-compose-viz \"Percentage of issues still open\")\n[![Docker Stars](https://img.shields.io/docker/stars/pmsipilot/docker-compose-viz.svg?style=flat)](https://hub.docker.com/r/pmsipilot/docker-compose-viz/)\n[![Docker Pulls](https://img.shields.io/docker/pulls/pmsipilot/docker-compose-viz.svg?style=flat)](https://hub.docker.com/r/pmsipilot/docker-compose-viz/)\n\n## How to use\n\n### Docker\n\nConsidering the current working directory is where your `docker-compose.yml` file is located:\n\n```sh\ndocker run --rm -it --name dcv -v $(pwd):/input pmsipilot/docker-compose-viz render -m image docker-compose.yml\n```\n\n```powershell\n# PowerShell\ndocker run --rm -it --name dcv -v ${pwd}:/input pmsipilot/docker-compose-viz render -m image docker-compose.yml\n```\n\nThis will generate the `docker-compose.png` file in the current working directory.\n\n### PHP\n\nBefore you start, make sure you have:\n\n* [Composer](https://getcomposer.org/doc/00-intro.md#installation-linux-unix-osx) installed,\n* [PHP 7.2](http://php.net/downloads.php#v7.2.32) (at least) installed,\n* GraphViz installed (see below for a guide on how to install it)\n\n#### Self-Compiled\n\n```sh\ngit clone https://github.com/pmsipilot/docker-compose-viz.git\n\nmake vendor\n```\n\n#### Via Composer\n\n```sh\ncomposer install --prefer-dist\n\nbin/dcv\n```\n\n#### Install GraphViz\n\n* On MacOS:\n\n   ```sh\n   brew install graphviz\n   ```\n\n* On Debian:\n\n   ```sh\n   sudo apt-get install graphviz\n   ```\n\n## Usage\n\n```sh\nUsage:\n  render [options] [--] [\u003cinput-file\u003e]\n\nArguments:\n  input-file                         Path to a docker compose file [default: \"./docker-compose.yml\"]\n\nOptions:\n      --override=OVERRIDE            Tag of the override file to use [default: \"override\"]\n  -o, --output-file=OUTPUT-FILE      Path to a output file (Only for \"dot\" and \"image\" output format) [default: \"./docker-compose.dot\" or \"./docker-compose.png\"]\n  -m, --output-format=OUTPUT-FORMAT  Output format (one of: \"dot\", \"image\", \"display\") [default: \"display\"]\n      --only=ONLY                    Display a graph only for a given services (multiple values allowed)\n  -f, --force                        Overwrites output file if it already exists\n      --no-volumes                   Do not display volumes\n  -r, --horizontal                   Display a horizontal graph\n      --ignore-override              Ignore override file\n```\n\n## How to read the graph\n\n### Links\n\nLinks (from `services.\u003cservice\u003e.links`) are displayed as plain arrows pointing to the service that declares the link:\n\n![links](resources/links.png)\n\nIf we look at the link between `mysql` and `ambassador`, it reads as follow: \"`mysql` is known as `mysql` in `ambassador`.\"\nIf we look at the link between `ambassador` and `logs`, it reads as follow: \"`ambassador` is known as `logstash` in `logs`.\"\n\nExternal links are displayed using the same shapes but are grayed:\n\n![external_links](resources/external_links.png)\n\n### Volumes\n\nVolumes (from `services.\u003cservice\u003e.volumes_from`) are displayed as dashed arrows pointing to the service that uses the volumes:\n\n![volumes](resources/volumes.png)\n\nIf we look at the link between `logs` and `api`, it reads as follow: \"`api` uses volumes from `logs`.\"\n\nVolumes (from `services.\u003cservice\u003e.volumes`) are displayed as folders with the host directory as label and are linked to the service that uses them dashed arrows.\n\nIf we look at the link between `./api` and `api`, it reads as follow: \"the host directory `./api`is mounted as a read-write folder on `/src` in `api`.\" Bidirectional arrows mean the directory is writable from the container.\n\nIf we look at the link between `./etc/api/php-fpm.d` and `api`, it reads as follow: \"the host directory `./etc/api/php-fpm.d`is mounted as a read-only folder on `/usr/local/etc/php-fpm.d` in `api`.\" Unidirectional arrows mean the directory is not writable from the container.\n\n### Dependencies\n\nDependencies (from `services.\u003cservice\u003e.depends_on`) are displayed as dotted arrows pointing to the service that declares the dependencies:\n\n![dependencies](resources/dependencies.png)\n\nIf we look at the link between `mysql` and `logs`, it reads as follow: \"`mysql` depends on `logs`.\"\n\n### Ports\n\nPorts (from `services.\u003cservice\u003e.ports`) are displayed as circle and are linked to containers using plain arrows pointing to the service that declares the ports:\n\n![ports](resources/ports.png)\n\nIf we look at the link between port `2480` and `orientdb`, it reads as follow: \"traffic coming to host port `2480` will be routed to port `2480` of `orientdb`.\"\nIf we look at the link between port `2580` and `elk`, it reads as follow: \"traffix coming to host port `2580` will be routed to port `80` of `elk`.\"\n\n### Extends\n\nExtended services (from `services.\u003cservice\u003e.extends`) are displayed as components (just like normal services). The links between them and the extending services are\ndisplayed as inverted arrows:\n\n![extends](resources/extends.png)\n\nIf we look at the link between `mysql` and `db`, it reads as follow: \"`mysql` extends  service `db`\".\n\n### Networks\n\nNetworks (from `networks.\u003cnetwork\u003e`) are displayed as pentagons. The links between them and services are displayed as plain arrows pointing to the network:\n\n![networks](resources/networks.png)\n\nIf we look at the link between `mysql` and the `global` network, it reads as follow: \"`mysql` is known as `mysql`, `db` and `reldb` in the `global` network.\n\nThe `legacy` network is an external so it's displayed as a grayed pentagon.\n\n## Examples\n\n### `dot` renderer\n\n```dot\ndigraph G {\n  graph [pad=0.5]\n  \"front\" [shape=\"component\"]\n  \"http\" [shape=\"component\"]\n  2380 [shape=\"circle\"]\n  \"ambassador\" [shape=\"component\"]\n  \"mysql\" [shape=\"component\"]\n  \"orientdb\" [shape=\"component\"]\n  \"elk\" [shape=\"component\"]\n  \"api\" [shape=\"component\"]\n  \"piwik\" [shape=\"component\"]\n  \"logs\" [shape=\"component\"]\n  \"html\" [shape=\"component\"]\n  2580 [shape=\"circle\"]\n  2480 [shape=\"circle\"]\n  \"http\" -\u003e \"front\" [style=\"solid\"]\n  2380 -\u003e \"front\" [style=\"solid\" label=80]\n  \"mysql\" -\u003e \"ambassador\" [style=\"solid\"]\n  \"orientdb\" -\u003e \"ambassador\" [style=\"solid\"]\n  \"elk\" -\u003e \"ambassador\" [style=\"solid\"]\n  \"api\" -\u003e \"http\" [style=\"solid\"]\n  \"piwik\" -\u003e \"http\" [style=\"solid\"]\n  \"logs\" -\u003e \"http\" [style=\"dashed\"]\n  \"piwik\" -\u003e \"http\" [style=\"dashed\"]\n  \"html\" -\u003e \"http\" [style=\"dashed\"]\n  \"ambassador\" -\u003e \"api\" [style=\"solid\" label=\"graphdb\"]\n  \"ambassador\" -\u003e \"api\" [style=\"solid\" label=\"reldb\"]\n  \"logs\" -\u003e \"api\" [style=\"dashed\"]\n  \"ambassador\" -\u003e \"logs\" [style=\"solid\" label=\"logstash\"]\n  2580 -\u003e \"elk\" [style=\"solid\" label=80]\n  \"ambassador\" -\u003e \"piwik\" [style=\"solid\" label=\"db\"]\n  2480 -\u003e \"orientdb\" [style=\"solid\"]\n}\n```\n\n### `image` renderer\n\n![image renderer](resources/image.png)\n\n### `display` renderer\n\n![display renderer](resources/display.png)\n\n### Troubleshooting\n\n#### Getting \"failed to open stream: Permission denied\"?\n\nMake sure the target directory is writeable by the user in the Docker container.\nOr create a writeable directory first. See [workaround #41](https://github.com/pmsipilot/docker-compose-viz/issues/41#issuecomment-483384999)\n\n## License\n\nThe MIT License (MIT)\nCopyright ® 2020 PMSIpilot\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmsipilot%2Fdocker-compose-viz","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpmsipilot%2Fdocker-compose-viz","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpmsipilot%2Fdocker-compose-viz/lists"}