mirror of
https://github.com/AbdBarho/stable-diffusion-webui-docker.git
synced 2025-11-01 02:33:20 -04:00
refactor: Support running Docker container as root or non-root user
This commit introduces flexibility in the Docker setup by allowing the container to run either as the `root` user or a specified non-root user. It updates both the `docker-compose.yml` and `Dockerfile` to include environment variables for setting the user ID, group ID, username, and group name. Additionally, it modifies the entrypoint script to handle these configurations appropriately, ensuring compatibility with different user setups.
This commit is contained in:
@@ -26,7 +26,7 @@ done
|
||||
|
||||
if [ "${USE_KRITA}" = "true" ]; then
|
||||
if [ "${KRITA_DOWNLOAD_MODELS:-false}" = "true" ]; then
|
||||
cd "${ROOT}/krita-ai-diffusion/scripts" && python download_models.py --recommended /data && cd ..
|
||||
cd "${ROOT}/krita-ai-diffusion/scripts" && python download_models.py --verbose --retry-attempts 10 --continue-on-error --recommended /data && cd ..
|
||||
fi
|
||||
[ -d "${ROOT}/models/upscale_models" ] && mv -v "${ROOT}/models/upscale_models" "${ROOT}/models/upscale_models.stock"
|
||||
if [ ! -L "${ROOT}/models/upscale_models" ]; then
|
||||
@@ -42,12 +42,12 @@ if [ "${USE_XFLUX}" = "true" ]; then
|
||||
[ ! -e "${CUSTOM_NODES}/x-flux-comfyui" ] && mv "${ROOT}/x-flux-comfyui" "${CUSTOM_NODES}"/
|
||||
[ ! -e "/data/models/clip_vision" ] && mkdir -p /data/models/clip_vision
|
||||
[ ! -e "/data/models/clip_vision/model.safetensors" ] && cd /data/models/clip_vision && \
|
||||
python -c 'import sys; from urllib.request import urlopen; from pathlib import Path; Path(sys.argv[2]).write_bytes(urlopen("".join([sys.argv[1],sys.argv[2]])).read())' \
|
||||
"https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/" "model.safetensors"
|
||||
python -c 'import sys; from urllib.request import urlopen; from pathlib import Path; Path(sys.argv[2]).write_bytes(urlopen(sys.argv[1]).read())' \
|
||||
"https://huggingface.co/openai/clip-vit-large-patch14/resolve/main/model.safetensors" "model.safetensors"
|
||||
[ ! -e "/data/models/xlabs" ] && mkdir -p /data/models/xlabs/{ipadapters,loras,controlnets}
|
||||
[ ! -e "/data/models/xlabs/ipadapters/flux-ip-adapter.safetensors" ] && cd /data/models/xlabs/ipadapters && \
|
||||
python -c 'import sys; from urllib.request import urlopen; from pathlib import Path; Path(sys.argv[2]).write_bytes(urlopen("".join([sys.argv[1],sys.argv[2]])).read())' \
|
||||
"https://huggingface.co/XLabs-AI/flux-ip-adapter/resolve/main/" "flux-ip-adapter.safetensors"
|
||||
python -c 'import sys; from urllib.request import urlopen; from pathlib import Path; Path(sys.argv[2]).write_bytes(urlopen(sys.argv[1]).read())' \
|
||||
"https://huggingface.co/XLabs-AI/flux-ip-adapter/resolve/main/ip_adapter.safetensors" "flux-ip-adapter.safetensors"
|
||||
[ -d "${ROOT}/models/xlabs" ] && rm -rf "${ROOT}/models/xlabs"
|
||||
[ ! -e "${ROOT}/models/xlabs" ] && cd "${ROOT}/models" && ln -sT /data/models/xlabs xlabs && cd ..
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user