From 4eb7fdccf15d75715589553b13911b383004d9fe Mon Sep 17 00:00:00 2001 From: Kaikawala Gedara Theekshana Nadun Bandara Kaikawla Date: Mon, 31 Mar 2025 11:32:02 +0530 Subject: [PATCH] 1st commit --- Dockerfile | 6 +++++- backend/start_windows.bat | 8 ++++++-- cloudbuild.yaml | 21 +++++++++++++++++++++ 3 files changed, 32 insertions(+), 3 deletions(-) create mode 100644 cloudbuild.yaml diff --git a/Dockerfile b/Dockerfile index 274e23dbf..24337a10a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -21,11 +21,15 @@ ARG UID=0 ARG GID=0 ######## WebUI frontend ######## -FROM --platform=$BUILDPLATFORM node:22-alpine3.20 AS build +FROM node:22-alpine3.20 AS build ARG BUILD_HASH WORKDIR /app +# Add this line to increase Node.js memory limit +ENV NODE_OPTIONS="--max-old-space-size=4096" + + COPY package.json package-lock.json ./ RUN npm ci diff --git a/backend/start_windows.bat b/backend/start_windows.bat index 7049cd1b3..92ac84a9e 100644 --- a/backend/start_windows.bat +++ b/backend/start_windows.bat @@ -1,4 +1,3 @@ -:: This method is not recommended, and we recommend you use the `start.sh` file with WSL instead. @echo off SETLOCAL ENABLEDELAYEDEXPANSION @@ -6,6 +5,9 @@ SETLOCAL ENABLEDELAYEDEXPANSION SET "SCRIPT_DIR=%~dp0" cd /d "%SCRIPT_DIR%" || exit /b +:: Activate the conda environment (replace 'open-webui' with your environment name) +CALL conda activate open-webui + :: Add conditional Playwright browser installation IF /I "%RAG_WEB_LOADER_ENGINE%" == "playwright" ( IF "%PLAYWRIGHT_WS_URI%" == "" ( @@ -13,7 +15,6 @@ IF /I "%RAG_WEB_LOADER_ENGINE%" == "playwright" ( playwright install chromium playwright install-deps chromium ) - python -c "import nltk; nltk.download('punkt_tab')" ) @@ -42,3 +43,6 @@ IF "%WEBUI_SECRET_KEY%%WEBUI_JWT_SECRET_KEY%" == " " ( :: Execute uvicorn SET "WEBUI_SECRET_KEY=%WEBUI_SECRET_KEY%" uvicorn open_webui.main:app --host "%HOST%" --port "%PORT%" --forwarded-allow-ips '*' + +:: Keep the window open +pause diff --git a/cloudbuild.yaml b/cloudbuild.yaml new file mode 100644 index 000000000..fd1ebf7d7 --- /dev/null +++ b/cloudbuild.yaml @@ -0,0 +1,21 @@ +steps: + # Build the container image + - name: 'gcr.io/cloud-builders/docker' + args: ['build', '-t', 'us-central1-docker.pkg.dev/ceylonally/ghcr/open-webui/open-webui:$COMMIT_SHA', '.'] + # Push the container image + - name: 'gcr.io/cloud-builders/docker' + args: ['push', 'us-central1-docker.pkg.dev/ceylonally/ghcr/open-webui/open-webui:$COMMIT_SHA'] + # Deploy to Cloud Run + - name: 'gcr.io/google.com/cloudsdktool/cloud-sdk' + entrypoint: gcloud + args: + - 'run' + - 'deploy' + - 'ceylonally' + - '--image' + - 'us-central1-docker.pkg.dev/ceylonally/ghcr/open-webui/open-webui:$COMMIT_SHA' + - '--region' + - 'us-central1' + - '--memory' + - '4Gi' + - '--allow-unauthenticated'