77 lines
3.1 KiB
Docker
77 lines
3.1 KiB
Docker
FROM node:22-bookworm-slim@sha256:6c74791e557ce11fc957704f6d4fe134a7bc8d6f5ca4403205b2966bd488f6b3 AS web-build
|
|
|
|
ARG OPEN_WEBUI_REF=v0.9.6
|
|
ARG OPEN_WEBUI_COMMIT=1a97751e376e00a1897bc3679215ae1c7bd8fd42
|
|
|
|
RUN apt-get update && apt-get install -y --no-install-recommends git ca-certificates \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
WORKDIR /src
|
|
RUN git clone --depth 1 --branch "${OPEN_WEBUI_REF}" https://github.com/open-webui/open-webui.git . \
|
|
&& test "$(git rev-parse HEAD)" = "${OPEN_WEBUI_COMMIT}"
|
|
|
|
COPY docker/web/ModelSelector.svelte src/lib/components/chat/ModelSelector.svelte
|
|
COPY docker/web/openwebui-no-rag.patch /tmp/openwebui-no-rag.patch
|
|
COPY docker/web/openwebui-local-storage.patch /tmp/openwebui-local-storage.patch
|
|
COPY docker/web/openwebui-lazy-azure.patch /tmp/openwebui-lazy-azure.patch
|
|
COPY docker/web/openwebui-product-ui.patch /tmp/openwebui-product-ui.patch
|
|
RUN git apply /tmp/openwebui-no-rag.patch \
|
|
&& git apply /tmp/openwebui-local-storage.patch \
|
|
&& git apply /tmp/openwebui-lazy-azure.patch \
|
|
&& git apply /tmp/openwebui-product-ui.patch
|
|
RUN npm ci --no-audit --no-fund \
|
|
&& npx vite build
|
|
|
|
FROM python:3.12-slim-bookworm@sha256:d50fb7611f86d04a3b0471b46d7557818d88983fc3136726336b2a4c657aa30b AS backend-deps
|
|
|
|
RUN apt-get update \
|
|
&& apt-get upgrade --yes --no-install-recommends \
|
|
&& apt-get install --yes --no-install-recommends build-essential \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY docker/web-requirements.txt /tmp/web-requirements.txt
|
|
RUN --mount=type=cache,target=/root/.cache/pip \
|
|
python -m pip install --upgrade pip==26.1.2 \
|
|
&& python -m pip download --only-binary=:all: --dest /wheels pip==26.1.2 \
|
|
&& python -m pip wheel --wheel-dir /wheels --requirement /tmp/web-requirements.txt
|
|
|
|
FROM python:3.12-slim-bookworm@sha256:d50fb7611f86d04a3b0471b46d7557818d88983fc3136726336b2a4c657aa30b
|
|
|
|
ENV PYTHONUNBUFFERED=1 \
|
|
ENV=prod \
|
|
PORT=8080 \
|
|
USE_OLLAMA_DOCKER=false \
|
|
USE_CUDA_DOCKER=false \
|
|
USE_SLIM_DOCKER=true \
|
|
SCARF_NO_ANALYTICS=true \
|
|
DO_NOT_TRACK=true \
|
|
ANONYMIZED_TELEMETRY=false \
|
|
VECTOR_DB=disabled \
|
|
DOCKER=true
|
|
|
|
RUN apt-get update \
|
|
&& apt-get upgrade --yes --no-install-recommends \
|
|
&& apt-get install --yes --no-install-recommends bash curl tini \
|
|
&& rm -rf /var/lib/apt/lists/*
|
|
|
|
COPY --from=backend-deps /wheels /wheels
|
|
COPY docker/web-requirements.txt /tmp/web-requirements.txt
|
|
RUN python -m pip install --no-cache-dir --no-index --find-links=/wheels --upgrade pip==26.1.2 \
|
|
&& python -m pip install --no-cache-dir --no-index --find-links=/wheels --requirement /tmp/web-requirements.txt \
|
|
&& rm -rf /wheels /tmp/web-requirements.txt
|
|
|
|
WORKDIR /app/backend
|
|
COPY --from=web-build /src/backend /app/backend
|
|
COPY --from=web-build /src/build /app/build
|
|
COPY --from=web-build /src/CHANGELOG.md /app/CHANGELOG.md
|
|
|
|
COPY --from=web-build /src/LICENSE /app/OPEN_WEBUI_LICENSE
|
|
COPY THIRD_PARTY_NOTICES.md /app/THIRD_PARTY_NOTICES.md
|
|
|
|
EXPOSE 8080
|
|
HEALTHCHECK --interval=15s --timeout=5s --retries=20 CMD \
|
|
curl --silent --fail http://127.0.0.1:8080/health
|
|
|
|
ENTRYPOINT ["/usr/bin/tini", "--"]
|
|
CMD ["bash", "start.sh"]
|