From 7132dc29f0c9e9f540b83b304f137d5cf46744d6 Mon Sep 17 00:00:00 2001 From: casjay Date: Mon, 2 Feb 2026 14:56:56 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=97=83=EF=B8=8F=20Update=20codebase=20?= =?UTF-8?q?=F0=9F=97=83=EF=B8=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Dockerfile rootfs/root/docker/setup/05-custom.sh rootfs/root/docker/setup/07-cleanup.sh --- Dockerfile | 3 ++- rootfs/root/docker/setup/05-custom.sh | 11 ++++++++++- rootfs/root/docker/setup/07-cleanup.sh | 8 ++++++++ 3 files changed, 20 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 344513d..bcbfb33 100644 --- a/Dockerfile +++ b/Dockerfile @@ -158,7 +158,8 @@ RUN echo "Custom Applications"; \ echo "" RUN echo "Running custom commands"; \ - if [ -f "/root/docker/setup/05-custom.sh" ];then echo "Running the custom script";/root/docker/setup/05-custom.sh||{ echo "Failed to execute /root/docker/setup/05-custom.sh" && exit 10; };echo "Done running the custom script";fi; \ + $SHELL_OPTS; \ + if [ -f "/root/docker/setup/05-custom.sh" ];then echo "Running the custom script";/root/docker/setup/05-custom.sh||{ echo "Failed to execute /root/docker/setup/05-custom.sh" >&2 && exit 10; };echo "Done running the custom script";fi; \ echo "" RUN echo "Running final commands before cleanup"; \ diff --git a/rootfs/root/docker/setup/05-custom.sh b/rootfs/root/docker/setup/05-custom.sh index 556dfab..5129ba1 100755 --- a/rootfs/root/docker/setup/05-custom.sh +++ b/rootfs/root/docker/setup/05-custom.sh @@ -83,8 +83,14 @@ python3 --version echo "Installing Open WebUI..." # Install Open WebUI using system Python (requires --break-system-packages in Docker) +# Split installation to avoid buildx timeout on large pip operations python3 -m pip install --break-system-packages --upgrade pip -python3 -m pip install --break-system-packages open-webui + +# Install with optimized flags to reduce build time and memory +# --no-cache-dir: Prevents caching to save space and avoid timeout issues +# --disable-pip-version-check: Faster installation +echo "Installing Open WebUI dependencies (this may take several minutes)..." +python3 -m pip install --break-system-packages --no-cache-dir --disable-pip-version-check open-webui # Verify Open WebUI installation if python3 -m open_webui --help >/dev/null 2>&1; then @@ -95,6 +101,9 @@ else echo "⚠ Warning: Open WebUI may not be in PATH, but should be installed" fi +# Clean pip cache to reduce image size +python3 -m pip cache purge 2>/dev/null || true + echo "✓ Ollama and Open WebUI installation complete" # - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/rootfs/root/docker/setup/07-cleanup.sh b/rootfs/root/docker/setup/07-cleanup.sh index 9c4770c..2804add 100755 --- a/rootfs/root/docker/setup/07-cleanup.sh +++ b/rootfs/root/docker/setup/07-cleanup.sh @@ -36,6 +36,14 @@ if [ -d "$HOME/.cache" ]; then rm -Rf "$HOME/.cache"; fi # - - - - - - - - - - - - - - - - - - - - - - - - - # Main script +# Clean up pip cache and temporary Python files to reduce image size +if command -v python3 >/dev/null 2>&1; then + python3 -m pip cache purge 2>/dev/null || true + find /usr -type d -name '__pycache__' -exec rm -rf {} + 2>/dev/null || true + find /usr -type f -name '*.pyc' -delete 2>/dev/null || true + find /usr -type f -name '*.pyo' -delete 2>/dev/null || true +fi + # - - - - - - - - - - - - - - - - - - - - - - - - - # Set the exit code #exitCode=$?