fix: links may not always have aliases
This commit is contained in:
parent
709e77a42a
commit
12e74b1164
4 changed files with 18 additions and 13 deletions
|
@ -85,7 +85,11 @@ class Graph:
|
||||||
self.add_vertex(port.host_port, "port", lable=port.host_port)
|
self.add_vertex(port.host_port, "port", lable=port.host_port)
|
||||||
self.add_edge(port.host_port, service.name, "ports", lable=port.container_port)
|
self.add_edge(port.host_port, service.name, "ports", lable=port.container_port)
|
||||||
for link in service.links:
|
for link in service.links:
|
||||||
self.add_edge(link.split(":")[0], service.name, "links", link.split(":")[1])
|
if ":" in link:
|
||||||
|
service_name, alias = link.split(":", 1)
|
||||||
|
self.add_edge(service_name, service.name, "links", alias)
|
||||||
|
else:
|
||||||
|
self.add_edge(link, service.name, "links")
|
||||||
for depends_on in service.depends_on:
|
for depends_on in service.depends_on:
|
||||||
self.add_edge(service.name, depends_on, "depends_on")
|
self.add_edge(service.name, depends_on, "depends_on")
|
||||||
|
|
||||||
|
|
|
@ -3,3 +3,5 @@ version: "3.9"
|
||||||
services:
|
services:
|
||||||
postgres:
|
postgres:
|
||||||
image: awesome/postgres
|
image: awesome/postgres
|
||||||
|
node:
|
||||||
|
image: awesome/node
|
Binary file not shown.
Before Width: | Height: | Size: 92 KiB After Width: | Height: | Size: 99 KiB |
|
@ -1,11 +1,6 @@
|
||||||
version: "3.9"
|
version: "3.9"
|
||||||
|
|
||||||
services:
|
services:
|
||||||
node:
|
|
||||||
build:
|
|
||||||
context: .
|
|
||||||
dockerfile: Dockerfile.node
|
|
||||||
|
|
||||||
api:
|
api:
|
||||||
image: "awesome/api"
|
image: "awesome/api"
|
||||||
extends:
|
extends:
|
||||||
|
@ -30,7 +25,6 @@ services:
|
||||||
- front-tier
|
- front-tier
|
||||||
- back-tier
|
- back-tier
|
||||||
command: ["npm", "start"]
|
command: ["npm", "start"]
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
extends:
|
extends:
|
||||||
service: node
|
service: node
|
||||||
|
@ -49,12 +43,11 @@ services:
|
||||||
networks:
|
networks:
|
||||||
- front-tier
|
- front-tier
|
||||||
command: ["npm", "start"]
|
command: ["npm", "start"]
|
||||||
|
|
||||||
db:
|
db:
|
||||||
image: "awesome/db"
|
image: "awesome/db"
|
||||||
extends:
|
extends:
|
||||||
service: postgres
|
service: postgres
|
||||||
file: postgres.yml
|
file: common-services.yml
|
||||||
restart: always
|
restart: always
|
||||||
networks:
|
networks:
|
||||||
- back-tier
|
- back-tier
|
||||||
|
@ -63,7 +56,6 @@ services:
|
||||||
- type: bind
|
- type: bind
|
||||||
source: /var/run/postgres/postgres.sock
|
source: /var/run/postgres/postgres.sock
|
||||||
target: /var/run/postgres/postgres.sock
|
target: /var/run/postgres/postgres.sock
|
||||||
|
|
||||||
redis:
|
redis:
|
||||||
image: "awesome/redis"
|
image: "awesome/redis"
|
||||||
restart: always
|
restart: always
|
||||||
|
@ -71,13 +63,20 @@ services:
|
||||||
- back-tier
|
- back-tier
|
||||||
expose:
|
expose:
|
||||||
- 6379
|
- 6379
|
||||||
|
|
||||||
adminer:
|
adminer:
|
||||||
image: "awesome/adminer"
|
image: "awesome/adminer"
|
||||||
networks:
|
links:
|
||||||
- back-tier
|
- db
|
||||||
ports:
|
ports:
|
||||||
- 8080:8080
|
- 8080:8080
|
||||||
|
proxy:
|
||||||
|
image: "awesome/proxy"
|
||||||
|
build:
|
||||||
|
context: .
|
||||||
|
dockerfile: Dockerfile.proxy
|
||||||
|
networks:
|
||||||
|
- front-tier
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
|
|
Loading…
Reference in a new issue