From c9826ca086b6da7585907f12b8ba446d1479eab2 Mon Sep 17 00:00:00 2001 From: TJ Horner Date: Sun, 1 Dec 2024 18:34:01 -0800 Subject: [PATCH] only use bridge network --- docker-compose.yml | 2 +- src/index.ts | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 2cc12b0..40b39e0 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,6 +1,6 @@ services: dragonify: - build: . + image: ghcr.io/tjhorner/dragonify:main restart: always volumes: - /var/run/docker.sock:/var/run/docker.sock diff --git a/src/index.ts b/src/index.ts index 5e92bcc..5e7dad8 100644 --- a/src/index.ts +++ b/src/index.ts @@ -28,6 +28,11 @@ function getDnsName(container: Docker.ContainerInfo) { } async function connectContainerToAppsNetwork(docker: Docker, container: Docker.ContainerInfo) { + if ([ "default", "bridge" ].includes(container.HostConfig.NetworkMode)) { + console.log(`Container ${container.Id} is not using bridge network; not connecting`) + return + } + const network = docker.getNetwork(NETWORK_NAME) const dnsName = getDnsName(container)