154 Commits

  • feat: build the Docker image from locked, hash-verified dependencies (#33981)
    The image used to install only the directly pinned packages and resolved everything below them fresh from PyPI on every build, so the same commit could produce different images. The standard and slim images now install from lock files that pin every package with hashes, except PyTorch and its few own dependencies, which still come from the PyTorch index so the CPU and CUDA variants keep working. A new CI check fails when a requirements file changes without regenerating its lock, and the script that regenerates them sits next to the requirements.
    
    Fixes #33979
  • fix: Ollama image ships without Ollama when its download fails during the build (#33944)
    The amd64 :ollama images of Open WebUI 0.13.1 and 0.13.2 ship without the ollama command (the arm64 images are fine). During the 0.13.1 build, downloading the Ollama install script failed with a server error, but the build did not notice and kept going, and 0.13.2 then reused that broken result from the build cache. The build now stops when Ollama is not installed after the install script ran, so a failed download can no longer produce a broken image. With this change the next build also installs Ollama fresh instead of reusing the broken cached result.
    
    Fixes #33942
  • fix: Docker, frontend CI and pip builds fail when the ONNX runtime GPU download times out (#33917)
    Installing the frontend dependencies makes the onnxruntime-node package download its GPU binaries from GitHub releases, and the whole install fails whenever that download times out. Neither the frontend build nor the Docker image uses those binaries (the image only ships the built frontend), so the Docker build, the frontend CI and building the Python package now skip that download with ONNXRUNTIME_NODE_INSTALL_CUDA=skip. The regular CPU binaries are part of the npm package and are not affected.
  • chore: Python 3.12 and Debian 13 base image (#32861)
    The Docker image now runs Python 3.12 on Debian 13 (trixie) instead of Python 3.11 on Debian 12, and the pip install docs recommend 3.12. Image size stays about the same: the slim image is 1 MB smaller and the standard image is about 50 MB larger, mostly from the newer ffmpeg and pandoc that Debian 13 ships. Admins should know that custom functions, tools and anything installed with pip inside the container now run on Python 3.12, so a package that only has builds for 3.11 needs a newer version. Installing with pip still works on both Python 3.11 and 3.12.
  • chore: stop shipping uv in the Docker image (#29728)
    The Docker image gets about 50 MB smaller on disk (about 20 MB off the pull). uv is only needed to run the requirements install, but it is pip-installed into the image and stays there. It is now bind-mounted from the uv image for that RUN only, pinned to 0.12.10, so the runtime image never contains it. This is the pattern uv's own Docker guide recommends for the case.
    
    Uninstalling uv at the end of the same RUN would also keep it out of the layer; the mount was preferred because it fixes the uv version and the mounted layer is cached by the builder across rebuilds.
    
    pip stays available in the container, so hand-installing optional packages the way requirements.txt describes keeps working; only running uv inside the container goes away. The build now requires BuildKit (the syntax directive alone was a comment to the classic builder, this line makes it mandatory), needs access to ghcr.io next to PyPI, and the uv version is a pin to bump by hand, like the base images.
    
    Part of #29721.
  • chore: drop nltk, unused at the pinned versions (#29725)
    The main and CUDA Docker images get about 21 MB smaller (the nltk package, the punkt_tab data and its zip); slim images, which never downloaded the data, about 6 MB.
    
    nltk was in the image for unstructured, which used it to tokenize documents. The Dockerfile download was added for airgapped containers failing on the missing punkt_tab data (#21150; the same request in #16260), the same lookup failed on first use in other setups (#17594, #4642), and the download in start.sh and start_windows.bat came with the Playwright web loader mode and sits in that branch.
    
    unstructured 0.22.31, the pinned version, has no nltk references at all and tokenizes with spaCy, nothing else installed requires nltk outside transformers' testing and dev extras, and nothing in the backend imports it, so the pin and both downloads go together.
    
    One user-visible consequence: a tool or function that imports nltk inside the container stops working unless it declares nltk in its frontmatter requirements. On an offline instance the package, and any nltk data such as punkt_tab, have to be installed into the image instead.
    
    Part of #29721.
  • chore: drop python3-dev from the Docker image (#29731)
    The apt layer of the Docker image shrinks by about 60 MB. python3-dev installs Debian's own interpreter with its headers, and nothing in the image uses it.
    
    The image's Python is the /usr/local build from the base image, which ships its own headers, and it is also the interpreter that installs tool and function requirements at runtime, so Debian's headers were never on the include path of anything built in the container. The zlib headers python3-dev pulled in stay through libmariadb-dev, which also brings the OpenSSL headers, so the optional mariadb connector still builds; the only other header package that goes with it is libexpat1-dev, which nothing in the pinned tree builds against.
    
    Part of #29721.
  • fix: download nltk data somewhere a non-root UID can read (#28866)
    nltk.download picks the first entry of nltk.data.path that already exists and is
    writable. None do here, so punkt_tab lands in /root/nltk_data, and /root is mode
    0700. The corpus is then unreachable whenever the container does not run as
    root:
    
        nltk.data.find('tokenizers/punkt_tab')
        LookupError: Resource punkt_tab not found.
    
    /usr/local/share/nltk_data is already on nltk.data.path, so nothing changes at
    the read side.
    
    Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
  • chore: drop test-only dependencies from the Docker image and the published package (#28726)
    The Python test suite was deleted in 4527c747b but its dependencies stayed behind, so pytest, pytest-docker and the docker SDK still install into every image variant, and moto joins them for anyone running pip install open-webui[all]. No Python test file remains in the repository, nothing imports these packages, and no CI job runs pytest. They are removed from backend/requirements.txt and from the all extra, which are the only two channels they ship through.
    
    netcat-openbsd goes for the same reason. It was added in January 2024 without a consumer and nc has never been invoked anywhere in the repository, in any script, workflow or compose file. Both the readiness wait and the healthcheck use curl, and the Ollama install script does not ask for it either.
    
    uv.lock is regenerated output, not hand-edited. It drops three of the four packages plus three transitives that nothing else needs, with no version changes and no additions. pytest stays locked because pytest-asyncio in the dev group still requires it. The dependency markers it adds on the CUDA and numpy entries are inert: each one is a superset of the condition its parent already installs under, and the resolved default install set is identical before and after.
    
    This saves roughly 2 MB uncompressed, which is nothing next to the image as a whole. The point is that a production image stops shipping a test framework and a Docker socket client it never uses.
    
    Everything else stays and is load-bearing. The container installs pip packages at runtime for user-authored tools and functions, so it needs git and a working compiler for anything that is not a prebuilt wheel, and libmariadb-dev for the manual MariaDB install. zstd is required for updating Ollama inside the bundled image. black looks dev-only but backs the code formatting endpoint.
    
    Ref: https://github.com/open-webui/open-webui/discussions/28716
  • refac
    Co-Authored-By: Solaris-star <67425364+solaris-star@users.noreply.github.com>
  • fix(docker): make open_webui/static writable by an arbitrary UID (OpenShift) (#26664)
    The backend rewrites its bundled static assets under open_webui/static on
    startup. Under OpenShift's restricted SCC the container runs as a random UID
    (member of GID 0), which cannot write to the root-owned static dir, so boot
    logs fill with '[Errno 13] Permission denied: .../static/*'.
    
    Give GID 0 the owner's permissions on that directory (chgrp 0 + chmod g=u),
    the standard Red Hat arbitrary-UID idiom. Applied unconditionally since the
    app writes there on every start; complements the opt-in USE_PERMISSION_HARDENING.
  • fix: pin torch to prevent startup errors on ARM devices (#21385)
    * fix: rpi
    
    * Update requirements-min.txt
    
    * Update requirements.txt
    
    * Update pyproject.toml
  • fix: bundle NLTK punkt_tab in Docker image for airgapped environments (#21165)
    Pre-download NLTK punkt_tab during Docker build instead of at runtime.
    This fixes document extraction failures in offline/airgapped environments
    where the container cannot download the tokenizer data after restarts.
    Fixes #21150
  • feat: add Docker publish workflow for multi-architecture builds
    fix: Dockerfile: make image arbitrary-UID friendly for OpenShift (group 0 + g+rwX, SGID, no fixed USER)