fix(photo-ai): persist pip cache to avoid re-downloading torch wheels
This commit is contained in:
+4
-5
@@ -6,8 +6,7 @@ ARG TORCH_INDEX=https://download.pytorch.org/whl/${TORCH_VARIANT}
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
ENV PIP_NO_CACHE_DIR=1 \
|
||||
PIP_BUILD_ISOLATION=0 \
|
||||
ENV PIP_BUILD_ISOLATION=0 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PYTHONUNBUFFERED=1 \
|
||||
HF_HOME=/root/.cache/huggingface \
|
||||
@@ -17,14 +16,14 @@ ENV PIP_NO_CACHE_DIR=1 \
|
||||
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends libgl1 libglib2.0-0 && rm -rf /var/lib/apt/lists/*
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
|
||||
pip install --upgrade pip && \
|
||||
pip install "typing-extensions==4.12.2" "numpy==2.2.6"
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
|
||||
pip install torch torchvision --index-url ${TORCH_INDEX}
|
||||
|
||||
RUN --mount=type=cache,target=/root/.cache/pip \
|
||||
RUN --mount=type=cache,target=/root/.cache/pip,sharing=locked \
|
||||
pip install --upgrade setuptools wheel && \
|
||||
pip install --no-build-isolation --no-deps basicsr==1.4.2 realesrgan==0.3.0 gfpgan==1.3.8 facexlib==0.3.0 && \
|
||||
pip install "numpy==2.2.6" "opencv-python-headless==5.0.0.93" addict future lmdb Pillow pyyaml \
|
||||
|
||||
Reference in New Issue
Block a user