Skip to content

An open-source, self-hostable PaaS alternative to Vercel, Heroku & Netlify that lets you easily deploy static sites, databases, full-stack applications and 360+ one-click services on your own servers.

fix: create coolify-infra, if it does not exists

Andras Bacsai2f724ffba275
diff --git a/apps/api/src/lib/common.ts b/apps/api/src/lib/common.ts
index 929aafc081..7617e53ab2 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<void> {
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