From b02f26aaf39162148c377e156718d3738f449f14 Mon Sep 17 00:00:00 2001 From: Teck Meng Date: Mon, 10 Jun 2024 16:04:54 +0800 Subject: [PATCH] Refactor openwebui.yml to use environment variable for OPEN_WEBUI_PORT --- swarm/openwebui.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/swarm/openwebui.yml b/swarm/openwebui.yml index bc0e13c..0d3f0db 100644 --- a/swarm/openwebui.yml +++ b/swarm/openwebui.yml @@ -2,6 +2,9 @@ networks: traefik-public: external: true +volumes: + open_webui: {} + services: open_webui: image: ghcr.io/open-webui/open-webui:${WEBUI_DOCKER_TAG:-main} @@ -11,7 +14,7 @@ services: - WEBUI_URL=http://localhost:${OPEN_WEBUI_PORT:-8080} - ENABLE_OLLAMA_API=${ENABLE_OLLAMA_API:-false} volumes: - - /var/data/open-webui:/app/backend/data + - open_webui:/app/backend/data expose: - ${OPEN_WEBUI_PORT:-8080} networks: @@ -19,7 +22,7 @@ services: deploy: placement: constraints: - - node.role == manager + - node.labels.open_webui.open_webui == true labels: - traefik.enable=true - traefik.docker.network=traefik-public