Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
chenpangpang
open-webui
Commits
7db4baef
Unverified
Commit
7db4baef
authored
May 16, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
May 16, 2024
Browse files
Merge pull request #2322 from cheahjs/feat/unsupported-nonroot-images
feat: optional UID/GID docker build args
parents
ba61f87a
1dc80786
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
5 deletions
+22
-5
Dockerfile
Dockerfile
+22
-5
No files found.
Dockerfile
View file @
7db4baef
...
...
@@ -11,6 +11,9 @@ ARG USE_CUDA_VER=cu121
# IMPORTANT: If you change the embedding model (sentence-transformers/all-MiniLM-L6-v2) and vice versa, you aren't able to use RAG Chat with your previous documents loaded in the WebUI! You need to re-embed them.
ARG
USE_EMBEDDING_MODEL=sentence-transformers/all-MiniLM-L6-v2
ARG
USE_RERANKING_MODEL=""
# Override at your own risk - non-root configurations are untested
ARG
UID=0
ARG
GID=0
######## WebUI frontend ########
FROM
--platform=$BUILDPLATFORM node:21-alpine3.19 as build
...
...
@@ -32,6 +35,8 @@ ARG USE_OLLAMA
ARG
USE_CUDA_VER
ARG
USE_EMBEDDING_MODEL
ARG
USE_RERANKING_MODEL
ARG
UID
ARG
GID
## Basis ##
ENV
ENV=prod \
...
...
@@ -76,9 +81,20 @@ ENV HF_HOME="/app/backend/data/cache/embedding/models"
WORKDIR
/app/backend
ENV
HOME /root
# Create user and group if not root
RUN if
[
$UID
-ne
0
]
;
then
\
if
[
$GID
-ne
0
]
;
then
\
addgroup
--gid
$GID
app
;
\
fi
;
\
adduser
--uid
$UID
--gid
$GID
--home
$HOME
--disabled-password
--no-create-home
app
;
\
fi
RUN
mkdir
-p
$HOME
/.cache/chroma
RUN
echo
-n
00000000-0000-0000-0000-000000000000
>
$HOME
/.cache/chroma/telemetry_user_id
# Make sure the user has access to the app and root directory
RUN
chown
-R
$UID
:
$GID
/app
$HOME
RUN if
[
"
$USE_OLLAMA
"
=
"true"
]
;
then
\
apt-get update
&&
\
# Install pandoc and netcat
...
...
@@ -102,7 +118,7 @@ RUN if [ "$USE_OLLAMA" = "true" ]; then \
fi
# install python dependencies
COPY
./backend/requirements.txt ./requirements.txt
COPY
--chown=$UID:$GID
./backend/requirements.txt ./requirements.txt
RUN
pip3
install
uv
&&
\
if
[
"
$USE_CUDA
"
=
"true"
]
;
then
\
...
...
@@ -125,16 +141,17 @@ RUN pip3 install uv && \
# COPY --from=build /app/onnx /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2/onnx
# copy built frontend files
COPY
--from=build /app/build /app/build
COPY
--from=build /app/CHANGELOG.md /app/CHANGELOG.md
COPY
--from=build /app/package.json /app/package.json
COPY
--chown=$UID:$GID
--from=build /app/build /app/build
COPY
--chown=$UID:$GID
--from=build /app/CHANGELOG.md /app/CHANGELOG.md
COPY
--chown=$UID:$GID
--from=build /app/package.json /app/package.json
# copy backend files
COPY
./backend .
COPY
--chown=$UID:$GID
./backend .
EXPOSE
8080
HEALTHCHECK
CMD curl --silent --fail http://localhost:8080/health | jq -e '.status == true' || exit 1
USER
$UID:$GID
CMD
[ "bash", "start.sh"]
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment