Skip to content

Commit 4f25c2c

Browse files
committed
chore(Dockerfile): install python deps early
To prevent huge redownloads on llm change.
1 parent 38a558d commit 4f25c2c

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

Dockerfile

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,15 @@ RUN npm install -g yarn
3636
COPY --from=ollama /usr/bin/ollama /usr/local/ollama/bin/ollama
3737
ENV PATH="/usr/local/ollama/bin:${PATH}"
3838

39+
40+
# Setup the app in workspace
41+
WORKDIR /workspace
42+
43+
# Install backend dependencies
44+
COPY --chmod=755 requirements.txt requirements.txt
45+
RUN pip install -r requirements.txt
46+
47+
3948
# Pull a language model (see LICENSE_STABLELM2.txt)
4049
# ARG OLLAMA_MODEL_NAME=openchat
4150
ARG OLLAMA_MODEL_NAME=stablelm2:1.6b-zephyr
@@ -47,14 +56,6 @@ ENV OLLAMA_URL=${OLLAMA_URL}
4756
RUN ollama serve & while ! curl ${OLLAMA_URL}; do sleep 1; done; ollama pull $OLLAMA_MODEL_NAME
4857

4958

50-
# Setup the custom API and frontend
51-
WORKDIR /workspace
52-
53-
# Install backend dependencies
54-
COPY --chmod=755 requirements.txt requirements.txt
55-
RUN pip install -r requirements.txt
56-
57-
5859
# Load sentence-transformers model once in order to cache it in the image
5960
# TODO: ARG / ENV for embedder model
6061
RUN echo "from haystack.components.embedders import SentenceTransformersDocumentEmbedder\nSentenceTransformersDocumentEmbedder(model='svalabs/german-gpl-adapted-covid').warm_up()" | python3

0 commit comments

Comments
 (0)