Browse Source

feat: docker for multi-user support updated

Timothy J. Baek 1 year ago
parent
commit
99e8816e73
3 changed files with 5 additions and 5 deletions
  1. 3 0
      Dockerfile
  2. 0 4
      backend/config.py
  3. 2 1
      compose.yaml

+ 3 - 0
Dockerfile

@@ -22,6 +22,9 @@ ARG OLLAMA_API_BASE_URL='/ollama/api'
 
 ENV ENV=prod
 ENV OLLAMA_API_BASE_URL $OLLAMA_API_BASE_URL
+ENV WEBUI_AUTH ""
+ENV WEBUI_DB_URL ""
+ENV WEBUI_JWT_SECRET_KEY "SECRET_KEY"
 
 WORKDIR /app
 COPY --from=build /app/build /app/build

+ 0 - 4
backend/config.py

@@ -55,7 +55,3 @@ if WEBUI_AUTH:
     ####################################
 
     WEBUI_JWT_SECRET_KEY = os.environ.get("WEBUI_JWT_SECRET_KEY", "t0p-s3cr3t")
-
-    if ENV == "prod":
-        if WEBUI_JWT_SECRET_KEY == "":
-            WEBUI_JWT_SECRET_KEY = str(b64encode(token_bytes(32)).decode())

+ 2 - 1
compose.yaml

@@ -46,8 +46,9 @@ services:
       - 3000:8080
     environment:
       - "OLLAMA_API_BASE_URL=http://ollama:11434/api"
-      - "WEBUI_DB_URL=mongodb://root:example@ollama-webui-db:27017/"
       - "WEBUI_AUTH=TRUE"
+      - "WEBUI_DB_URL=mongodb://root:example@ollama-webui-db:27017/"
+      - "WEBUI_JWT_SECRET_KEY=SECRET_KEY"
     extra_hosts:
       - host.docker.internal:host-gateway
     restart: unless-stopped