From c5a9ae6d6dbebb44d4b560b00c8a2df952bc6f0b Mon Sep 17 00:00:00 2001 From: derek Date: Thu, 30 Mar 2023 16:54:26 -0500 Subject: [PATCH] Updating so webui-user.sh does not have to be updated on first run --- docker-compose.yml | 12 ++++++------ entrypoint.sh | 8 ++++---- webui-user.sh | 2 +- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 4590e006..12a84b32 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -7,8 +7,8 @@ services: ports: - "7860:7860" volumes: - - ./sd:/sd - - "/path/to/models:/sd/models/Stable-diffusion" + - ./:/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 deploy: resources: reservations: @@ -17,8 +17,8 @@ services: device_ids: ['0'] capabilities: [gpu] healthcheck: - test: "wget --no-verbose --tries=1 --spider http://auto-sd-docker:7860 || exit 1" - interval: 2m - timeout: 30s + test: "wget --no-verbose --tries=1 --spider http://localhost:7860 || exit 1" + interval: 60s + timeout: 10s retries: 5 - start_period: 5m \ No newline at end of file + start_period: 300s \ No newline at end of file diff --git a/entrypoint.sh b/entrypoint.sh index 16984770..e869eeaf 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -4,7 +4,7 @@ ####################################################### # Determine if repo is already cloned -if [[ -d /sd/.git && -f /sd/webui.sh ]] +if [[ -d /repo/.git && -f /repo/webui.sh ]] then # repo already cloned echo "Repo already cloned." @@ -12,17 +12,17 @@ else # clone the repo echo "Repo missing, cloning now." git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git /repo_temp - rsync -a /repo_temp/ /sd/ + rsync -a /repo_temp/ /repo/ rm -rf /repo_temp fi -cd /sd +cd /repo # --listen is always required while running inside a container if [[ ! $COMMANDLINE_ARGS =~ "--listen" ]] then # this could still be overwritten by webui-user.sh - COMMANDLINE_ARGS="--listen ${COMMANDLINE_ARGS}" + export COMMANDLINE_ARGS="--listen ${COMMANDLINE_ARGS}" fi # Start webui.sh, -f flag allows running as root diff --git a/webui-user.sh b/webui-user.sh index bfa53cb7..71b30467 100644 --- a/webui-user.sh +++ b/webui-user.sh @@ -10,7 +10,7 @@ #clone_dir="stable-diffusion-webui" # Commandline arguments for webui.py, for example: export COMMANDLINE_ARGS="--medvram --opt-split-attention" -#export COMMANDLINE_ARGS="" +#export COMMANDLINE_ARGS="$COMMANDLINE_ARGS" # python3 executable #python_cmd="python3"