mirror of
https://github.com/open-webui/open-webui.git
synced 2025-12-12 04:15:25 +00:00
refac/fix: dockerfile ollama cache issue
This commit is contained in:
parent
72168b1586
commit
115231c0e5
1 changed files with 14 additions and 24 deletions
38
Dockerfile
38
Dockerfile
|
|
@ -108,29 +108,13 @@ RUN echo -n 00000000-0000-0000-0000-000000000000 > $HOME/.cache/chroma/telemetry
|
||||||
# Make sure the user has access to the app and root directory
|
# Make sure the user has access to the app and root directory
|
||||||
RUN chown -R $UID:$GID /app $HOME
|
RUN chown -R $UID:$GID /app $HOME
|
||||||
|
|
||||||
RUN if [ "$USE_OLLAMA" = "true" ]; then \
|
# Install common system dependencies
|
||||||
apt-get update && \
|
RUN apt-get update && \
|
||||||
# Install pandoc and netcat
|
apt-get install -y --no-install-recommends \
|
||||||
apt-get install -y --no-install-recommends git build-essential pandoc netcat-openbsd curl && \
|
git build-essential pandoc gcc netcat-openbsd curl jq \
|
||||||
apt-get install -y --no-install-recommends gcc python3-dev && \
|
python3-dev \
|
||||||
# for RAG OCR
|
ffmpeg libsm6 libxext6 \
|
||||||
apt-get install -y --no-install-recommends ffmpeg libsm6 libxext6 && \
|
&& rm -rf /var/lib/apt/lists/*
|
||||||
# install helper tools
|
|
||||||
apt-get install -y --no-install-recommends curl jq && \
|
|
||||||
# install ollama
|
|
||||||
curl -fsSL https://ollama.com/install.sh | sh && \
|
|
||||||
# cleanup
|
|
||||||
rm -rf /var/lib/apt/lists/*; \
|
|
||||||
else \
|
|
||||||
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/*; \
|
|
||||||
fi
|
|
||||||
|
|
||||||
# install python dependencies
|
# install python dependencies
|
||||||
COPY --chown=$UID:$GID ./backend/requirements.txt ./requirements.txt
|
COPY --chown=$UID:$GID ./backend/requirements.txt ./requirements.txt
|
||||||
|
|
@ -152,7 +136,13 @@ RUN pip3 install --no-cache-dir uv && \
|
||||||
fi; \
|
fi; \
|
||||||
chown -R $UID:$GID /app/backend/data/
|
chown -R $UID:$GID /app/backend/data/
|
||||||
|
|
||||||
|
# Install Ollama if requested
|
||||||
|
RUN if [ "$USE_OLLAMA" = "true" ]; then \
|
||||||
|
date +%s > /tmp/ollama_build_hash && \
|
||||||
|
echo "Cache broken at timestamp: `cat /tmp/ollama_build_hash`" && \
|
||||||
|
curl -fsSL https://ollama.com/install.sh | sh && \
|
||||||
|
rm -rf /var/lib/apt/lists/*; \
|
||||||
|
fi
|
||||||
|
|
||||||
# copy embedding weight from build
|
# copy embedding weight from build
|
||||||
# RUN mkdir -p /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
|
# RUN mkdir -p /root/.cache/chroma/onnx_models/all-MiniLM-L6-v2
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue