From 2f724ffba275f17de1b78aaa2e44316b61bbc1df Mon Sep 17 00:00:00 2001 From: Andras Bacsai Date: Mon, 15 Aug 2022 10:28:57 +0000 Subject: [PATCH] fix: create coolify-infra, if it does not exists --- apps/api/src/lib/common.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts index 929aafc08..7617e53ab 100644 --- a/apps/api/src/lib/common.ts +++ b/apps/api/src/lib/common.ts @@ -595,6 +595,11 @@ export async function startTraefikProxy(id: string): Promise { const { id: settingsId, ipv4, ipv6 } = await listSettings(); if (!found) { + const { stdout: coolifyNetwork } = await executeDockerCmd({ dockerId: id, command: `docker network ls --filter 'name=coolify-infra' --no-trunc --format "{{json .}}"` }) + + if (!coolifyNetwork) { + await executeDockerCmd({ dockerId: id, command: `docker network create --attachable coolify-infra` }) + } const { stdout: Config } = await executeDockerCmd({ dockerId: id, command: `docker network inspect ${network} --format '{{json .IPAM.Config }}'` }) const ip = JSON.parse(Config)[0].Gateway; let traefikUrl = mainTraefikEndpoint