auto_sd_docker/entrypoint.sh

30 lines
843 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
# Start webui.sh, -f flag allows running as root
./webui.sh -f