@@ -135,21 +135,23 @@ RUN apt-get update && \
135135# install python dependencies
136136COPY --chown=$UID:$GID ./backend/requirements.txt ./requirements.txt
137137
138- RUN set -e; \
139- pip3 install --no-cache-dir uv; \
138+ RUN --mount=type=cache,target=/root/.cache/pip \
139+ --mount=type=cache,target=/root/.cache/uv \
140+ set -e; \
141+ pip3 install uv; \
140142 if [ "$USE_CUDA" = "true" ]; then \
141143 # If you use CUDA the whisper and embedding model will be downloaded on first use
142144 # fix: pin torch<=2.9.1 - torch 2.10.0 aarch64 wheels cause SIGILL on ARM devices (RPi 4 Cortex-A72) #21349
143- pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER --no-cache-dir ; \
144- uv pip install --system -r requirements.txt --no-cache-dir ; \
145+ pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/$USE_CUDA_DOCKER_VER; \
146+ uv pip install --system -r requirements.txt; \
145147 python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" ; \
146148 python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('AUXILIARY_EMBEDDING_MODEL', 'TaylorAI/bge-micro-v2'), device='cpu')" ; \
147149 python -c "import os; from faster_whisper import WhisperModel; WhisperModel(os.environ['WHISPER_MODEL'], device='cpu', compute_type='int8', download_root=os.environ['WHISPER_MODEL_DIR'])" ; \
148150 python -c "import os; import tiktoken; tiktoken.get_encoding(os.environ['TIKTOKEN_ENCODING_NAME'])" ; \
149151 python -c "import nltk; nltk.download('punkt_tab')" ; \
150152 else \
151- pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu --no-cache-dir ; \
152- uv pip install --system -r requirements.txt --no-cache-dir ; \
153+ pip3 install 'torch<=2.9.1' torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu; \
154+ uv pip install --system -r requirements.txt; \
153155 if [ "$USE_SLIM" != "true" ]; then \
154156 python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ['RAG_EMBEDDING_MODEL'], device='cpu')" ; \
155157 python -c "import os; from sentence_transformers import SentenceTransformer; SentenceTransformer(os.environ.get('AUXILIARY_EMBEDDING_MODEL', 'TaylorAI/bge-micro-v2'), device='cpu')" ; \
0 commit comments