Skip to content

Generates a DOT file for a service found in a docker-compose.yml file

Notifications You must be signed in to change notification settings

app-nerds/docker-compose-depends

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Docker Compose Dependency Graph Generator

This tool generates a DOT file for a service found in a docker-compose.yml file. These DOT files can then be fed into GraphViz to generate a graph.

Example Graph

Example

go run . -in="./docker-compose.yml" -service="your-service-name"

This will produce output that looks like this.

digraph G {
	"send-comunication" -> "nsqd"
	"nsqd" -> "nsqlookupd"
	"send-comunication" -> "nsqlookupd"
	"send-comunication" -> "process-image"
	"process-image" -> "nsqd"
	"process-image" -> "nsqlookupd"
	"process-image" -> "nsqadmin"
	"nsqadmin" -> "nsqlookupd"
	"process-image" -> "upload-ui"
	"upload-ui" -> "nsqd"
	"upload-ui" -> "nsqlookupd"
	"upload-ui" -> "nsqadmin"
}

Then if you wish you can use the GraphViz executable to create a graphic. For example:

go run . -in="./docker-compose.yml" -service="your-service-name" > input.dot
dot -Tpng input.dot -o output.png

Or string it together like so.

go run . -in="./docker-compose.yml" -service="your-service-name" | dot -Tpng -o output.png

You can also list all of the services found in the docker-compose.yml file.

go run . -in="./docker-compose.yml" -list="true"

About

Generates a DOT file for a service found in a docker-compose.yml file

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages