From 56564585a134fdc7b2b26921f25f31d18f8bcf9d Mon Sep 17 00:00:00 2001 From: simonmcnair <101189766+simonmcnair@users.noreply.github.com> Date: Mon, 10 Mar 2025 23:22:40 +0000 Subject: [PATCH] Update Dockerfile test --- services/forge/Dockerfile | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/services/forge/Dockerfile b/services/forge/Dockerfile index d9464f4..038b2f7 100644 --- a/services/forge/Dockerfile +++ b/services/forge/Dockerfile @@ -20,7 +20,7 @@ FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-runtime ENV DEBIAN_FRONTEND=noninteractive PIP_PREFER_BINARY=1 -RUN --mount=type=cache,target=/var/cache/apt \ +RUN --mount=type=cache,target=/root/apt \ apt-get update && \ # we need those apt-get install -y fonts-dejavu-core rsync git jq moreutils aria2 \ @@ -68,13 +68,12 @@ RUN if [ "$PUID" -ne "0" ]; then \ ENV ROOT=/stable-diffusion-webui-forge WORKDIR / -RUN --mount=type=cache,target=${USER_HOME}/.cache/pip \ +RUN --mount=type=cache,target=/root/.cache/forge-repo \ git clone https://github.com/lllyasviel/stable-diffusion-webui-forge.git && \ cd stable-diffusion-webui-forge && \ sed -i '/torch/d' requirements_versions.txt && \ pip install -r requirements_versions.txt -RUN chown -R "$PUID:$PGID" "${ROOT}" RUN \ # mv ${ROOT}/style.css ${ROOT}/user.css && \ @@ -88,18 +87,16 @@ USER $PUID:$PGID COPY --from=download --chown=${PUID}:${PGID} /repositories/ ${ROOT}/repositories/ RUN mkdir ${ROOT}/interrogate && cp ${ROOT}/repositories/clip-interrogator/clip_interrogator/data/* ${ROOT}/interrogate -RUN --mount=type=cache,target=${USER_HOME}/.cache/pip \ - pip install -r ${ROOT}/repositories/CodeFormer/requirements.txt +RUN --mount=type=cache,target=/root/.cache/codeformer pip install -r ${ROOT}/repositories/CodeFormer/requirements.txt # Clone and copy huggingface_guess module #RUN git clone https://github.com/lllyasviel/huggingface_guess.git /tmp/huggingface_guess && \ # cp -r /tmp/huggingface_guess/huggingface_guess ${ROOT}/huggingface_guess # Ensure torchvision is correctly installed -RUN --mount=type=cache,target=${USER_HOME}/.cache/pip \ - pip install torchvision==0.18.1 +RUN --mount=type=cache,target=/root/.cache/torch pip install torchvision==0.18.1 -RUN --mount=type=cache,target=${USER_HOME}/.cache/pip \ +RUN --mount=type=cache,target=/root/.cache/repos \ pip install pyngrok xformers==0.0.27 pytorch_lightning torchdiffeq torchsde \ git+https://github.com/TencentARC/GFPGAN.git@8d2447a2d918f8eba5a4a01463fd48e45126a379 \ git+https://github.com/openai/CLIP.git@d50d76daa670286dd6cacf3bcd80b5e4823fc8e1 \ @@ -109,7 +106,10 @@ RUN --mount=type=cache,target=${USER_HOME}/.cache/pip \ ENV LD_PRELOAD=libtcmalloc.so -COPY --chown=$PUID:$PGID . /docker +COPY . /docker + +RUN chown -R "$PUID:$PGID" "${ROOT}" +RUN chown -R "$PUID:$PGID" /docker WORKDIR ${ROOT}