auto_sd_docker/entrypoint.sh

36 lines
968 B
Bash

#!/usr/bin/env bash
#######################################################
# This is the entrypoint script for the app container #
#######################################################
# Determine if repo is already cloned
if [[ -d /repo/.git && -f /repo/webui.sh ]]
then
# repo already cloned
echo "Repo already cloned."
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/ /repo/
rm -rf /repo_temp
fi
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
export COMMANDLINE_ARGS="--listen ${COMMANDLINE_ARGS}"
fi
# Remove the tmp directory
rm -rf /tmp
# Create /tmp/gradio since auto cannot make it for some reason
mkdir -p /tmp/gradio
# Start webui.sh, -f flag allows running as root
./webui.sh -f