diff --git a/compose_viz/graph.py b/compose_viz/graph.py index a803c6a..0d9a8a9 100644 --- a/compose_viz/graph.py +++ b/compose_viz/graph.py @@ -99,7 +99,7 @@ class Graph: self.add_edge(service.extends.service_name, service.name, "extends") if service.cgroup_parent is not None: self.add_vertex(service.cgroup_parent, "cgroup") - self.add_edge(service.cgroup_parent, service.name, "links") + self.add_edge(service.name, service.cgroup_parent, "links") for network in service.networks: self.add_vertex(network, "network", lable=f"net:{network}") @@ -131,7 +131,7 @@ class Graph: self.add_edge(service.name, depends_on, "depends_on") for porfile in service.profiles: self.add_vertex(porfile, "porfile") - self.add_edge(porfile, service.name, "links") + self.add_edge(service.name, porfile, "links") for device in service.devices: self.add_vertex(device.host_path, "device") self.add_edge( diff --git a/examples/non-normative/compose-viz.png b/examples/non-normative/compose-viz.png index c43d74d..f4fdb1e 100644 Binary files a/examples/non-normative/compose-viz.png and b/examples/non-normative/compose-viz.png differ diff --git a/examples/non-normative/docker-compose.yml b/examples/non-normative/docker-compose.yml index 2ed41b9..8419c98 100644 --- a/examples/non-normative/docker-compose.yml +++ b/examples/non-normative/docker-compose.yml @@ -6,10 +6,19 @@ services: - back-tier monitoring: + env_file: + - a.env + - b.env + container_name: monitoring-server image: awesome/monitoring networks: - admin - + expose: + - 1234 + profiles: + - tools + - foo + cgroup_parent: awesome-parent backend: networks: @@ -36,8 +45,12 @@ services: - "8000:5010" links: - "db:database" + cgroup_parent: awesome-parent db: image: postgres + devices: + - "/dev/ttyUSB2:/dev/ttyUSB3" + - "/dev/sda:/dev/xvda:rwm" networks: front-tier: