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
34e54454
Unverified
Commit
34e54454
authored
Jan 07, 2024
by
Timothy Jaeryang Baek
Committed by
GitHub
Jan 07, 2024
Browse files
Merge pull request #423 from ollama-webui/dev
feat: slimmer docker image
parents
9c443316
02f364bf
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
17 additions
and
5 deletions
+17
-5
Dockerfile
Dockerfile
+16
-0
backend/requirements.txt
backend/requirements.txt
+0
-4
run.sh
run.sh
+1
-1
No files found.
Dockerfile
View file @
34e54454
...
@@ -4,12 +4,16 @@ FROM node:alpine as build
...
@@ -4,12 +4,16 @@ FROM node:alpine as build
WORKDIR
/app
WORKDIR
/app
# wget embedding model weight from alpine (does not exist from slim-buster)
RUN
wget
"https://chroma-onnx-models.s3.amazonaws.com/all-MiniLM-L6-v2/onnx.tar.gz"
COPY
package.json package-lock.json ./
COPY
package.json package-lock.json ./
RUN
npm ci
RUN
npm ci
COPY
. .
COPY
. .
RUN
npm run build
RUN
npm run build
FROM
python:3.11-slim-bookworm as base
FROM
python:3.11-slim-bookworm as base
ENV
ENV=prod
ENV
ENV=prod
...
@@ -22,12 +26,24 @@ ENV OPENAI_API_KEY ""
...
@@ -22,12 +26,24 @@ ENV OPENAI_API_KEY ""
ENV
WEBUI_JWT_SECRET_KEY "SECRET_KEY"
ENV
WEBUI_JWT_SECRET_KEY "SECRET_KEY"
WORKDIR
/app
WORKDIR
/app
# copy embedding weight from build
RUN
mkdir
-p
/root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
COPY
--from=build /app/onnx.tar.gz /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
RUN
cd
/root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
&&
\
tar
-xzf
onnx.tar.gz
# copy built frontend files
COPY
--from=build /app/build /app/build
COPY
--from=build /app/build /app/build
WORKDIR
/app/backend
WORKDIR
/app/backend
COPY
./backend/requirements.txt ./requirements.txt
COPY
./backend/requirements.txt ./requirements.txt
RUN
pip3
install
torch torchvision torchaudio
--index-url
https://download.pytorch.org/whl/cpu
RUN
pip3
install
-r
requirements.txt
RUN
pip3
install
-r
requirements.txt
# RUN python -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')"
# RUN python -c "from sentence_transformers import SentenceTransformer; model = SentenceTransformer('all-MiniLM-L6-v2')"
COPY
./backend .
COPY
./backend .
...
...
backend/requirements.txt
View file @
34e54454
...
@@ -16,10 +16,6 @@ aiohttp
...
@@ -16,10 +16,6 @@ aiohttp
peewee
peewee
bcrypt
bcrypt
torch --index-url https://download.pytorch.org/whl/cpu
torchvision --index-url https://download.pytorch.org/whl/cpu
torchaudio --index-url https://download.pytorch.org/whl/cpu
langchain
langchain
langchain-community
langchain-community
chromadb
chromadb
...
...
run.sh
View file @
34e54454
docker build
-t
ollama-webui
.
docker stop ollama-webui
||
true
docker stop ollama-webui
||
true
docker
rm
ollama-webui
||
true
docker
rm
ollama-webui
||
true
docker build
-t
ollama-webui
.
docker run
-d
-p
3000:8080
--add-host
=
host.docker.internal:host-gateway
-v
ollama-webui:/app/backend/data
--name
ollama-webui
--restart
always ollama-webui
docker run
-d
-p
3000:8080
--add-host
=
host.docker.internal:host-gateway
-v
ollama-webui:/app/backend/data
--name
ollama-webui
--restart
always ollama-webui
docker image prune
-f
docker image prune
-f
\ No newline at end of file
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