This repository was archived by the owner on May 5, 2026. It is now read-only.
forked from open-webui/open-webui
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (50 loc) · 1.72 KB
/
Dockerfile
File metadata and controls
70 lines (50 loc) · 1.72 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# syntax=docker/dockerfile:1
# Initialize device type args
# use build args in the docker build command with --build-arg="BUILDARG=true"
ARG BUILD_HASH=dev-build
######## WebUI frontend ########
FROM --platform=$BUILDPLATFORM node:22-alpine3.20 AS build
ARG BUILD_HASH
WORKDIR /app
COPY package.json package-lock.json ./
RUN npm ci
COPY . .
ENV APP_BUILD_HASH=${BUILD_HASH}
ENV NODE_OPTIONS=--max-old-space-size=3300
RUN npm run build
######## WebUI backend ########
FROM python:3.11-slim-bookworm AS base
## Basis ##
ENV ENV=prod \
PORT=8080
# Disable tracking by library "unstructrured": SCARF_NO_ANALYTICS, DO_NOT_TRACK
ENV SCARF_NO_ANALYTICS=true \
DO_NOT_TRACK=true
WORKDIR /app/backend
ENV HOME=/root
RUN apt-get update && \
# Install pandoc, netcat and gcc
apt-get install -y --no-install-recommends git build-essential pandoc gcc netcat-openbsd curl jq && \
apt-get install -y --no-install-recommends gcc python3-dev && \
# for RAG OCR
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
# cleanup
rm -rf /var/lib/apt/lists/*;
# install python dependencies
COPY uv.lock pyproject.toml .
# Make uv sync install dependencies from uv.lock to the
# system packages location, not a virtual environment
ENV UV_PROJECT_ENVIRONMENT=/usr/local
RUN pip3 install --no-cache-dir uv && \
uv sync --locked
# copy built frontend files
COPY --from=build /app/build /app/build
COPY --from=build /app/package.json /app/package.json
# copy backend files
COPY ./backend .
EXPOSE 8080
HEALTHCHECK CMD curl --silent --fail http://localhost:${PORT:-8080}/health | jq -ne 'input.status == true' || exit 1
ARG BUILD_HASH
ENV WEBUI_BUILD_VERSION=${BUILD_HASH}
ENV DOCKER=true
CMD [ "bash", "start.sh"]