From 96f942e7a093dd81906343fff5c035ce2a0fd338 Mon Sep 17 00:00:00 2001 From: AaronDewes Date: Thu, 10 Mar 2022 18:59:24 +0000 Subject: [PATCH] Fixes for apps which use the host network --- app/lib/composegenerator/v2/networking.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/app/lib/composegenerator/v2/networking.py b/app/lib/composegenerator/v2/networking.py index c0a6744..361c50f 100644 --- a/app/lib/composegenerator/v2/networking.py +++ b/app/lib/composegenerator/v2/networking.py @@ -85,6 +85,8 @@ def configureMainPort(app: AppStage2, nodeRoot: str) -> AppStage3: def configureIps(app: AppStage2, networkingFile: str, envFile: str): for container in app.containers: + if container.network_mode and container.network_mode == "host": + continue if container.noNetwork: # Check if port is defined for the container if container.port: @@ -107,6 +109,8 @@ def configureHiddenServices(app: AppStage3, nodeRoot: str) -> AppStage3: mainContainer = getMainContainer(app) for container in app.containers: + if container.network_mode and container.network_mode == "host": + continue env_var = "APP_{}_{}_IP".format( app.metadata.id.upper().replace("-", "_"), container.name.upper().replace("-", "_")