diff --git a/Dockerfile b/Dockerfile index 8104c7272..1e8361fd2 100644 --- a/Dockerfile +++ b/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 diff --git a/backend/config.py b/backend/config.py index d19ebdbd0..dd1c0b617 100644 --- a/backend/config.py +++ b/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()) diff --git a/compose.yaml b/compose.yaml index 43aaf96e5..aa66d6540 100644 --- a/compose.yaml +++ b/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