From eccfd27370b26521a524b3303ffe988e658b29e5 Mon Sep 17 00:00:00 2001 From: derek Date: Tue, 2 May 2023 08:40:59 -0500 Subject: [PATCH] Using libgl1 lib instead of the entire python3-opencv to reduce image size. Adding volume to image for the downloaded repo to make it persistent if not mapped. Adding examples for external models in docker-compose. --- Dockerfile | 4 +++- docker-compose.yml | 8 ++++++-- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 023ede99..68ff8b57 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,10 +3,12 @@ FROM python:3.10 WORKDIR / RUN apt update \ - && apt install -y wget git htop python3-opencv rsync + && apt install -y wget git htop libgl1 rsync COPY ./entrypoint.sh . EXPOSE 7860 +VOLUME [ "/repo" ] + CMD [ "./entrypoint.sh" ] diff --git a/docker-compose.yml b/docker-compose.yml index 068306c4..d7b60189 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -9,8 +9,12 @@ services: ports: - "7860:7860" volumes: - - ./:/repo # The path the repo will be cloned into if it does not already exist - # - "/path/to/models:/sd/models/Stable-diffusion/remote" # The path to existing models to use + - ./:/repo # The path the repo, will be cloned into if it does not already exist + # Paths to existing models. Should bind to a subdirectory of the repo folder for that type with examples below + # - "/path/to/models:/repo/models/Stable-diffusion/remote" + # - "/path/to/embeddings:/repo/embeddings/remote" + # - "/path/to/VAE:/repo/models/VAE/remote" + # - "/path/to/Lora:/repo/models/Lora/remote" deploy: resources: reservations: