Update Dockerfile

test
This commit is contained in:
simonmcnair 2025-03-10 23:22:40 +00:00 committed by GitHub
parent bfd834d8be
commit 56564585a1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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}