Skip to content

Commit

Permalink
fix: update Dockerfile to set ownership of USERDATA_DIR before execution
Browse files Browse the repository at this point in the history
  • Loading branch information
sammrai committed Jan 8, 2025
1 parent 719dd8e commit 4e73597
Showing 1 changed file with 2 additions and 9 deletions.
11 changes: 2 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,17 +58,10 @@ ENV venv_dir="-"
ENV no_proxy="localhost, 127.0.0.1, ::1"

ENTRYPOINT ["/bin/bash", "-c", "\
[ $(stat -c %u:%g $USERDATA_DIR) = '1000:1000' ] || { \
echo 'Error: The data directory ownership is incorrect.'; \
echo 'Expected ownership: UID:GID = 1000:1000'; \
echo \"Current ownership: $(stat -c %u:%g $USERDATA_DIR)\"; \
echo 'Please change the ownership of the data directory using:'; \
echo ' chown -R 1000:1000 $USERDATA_DIR'; \
exit 1; \
}; \
chown -R 1000:1000 $USERDATA_DIR && \
civitconfig default --api-key $CIVITAI_TOKEN || true; \
civitconfig alias --add @lora $USERDATA_DIR/models/Lora && \
civitconfig alias --add @vae $USERDATA_DIR/models/VAE && \
civitconfig alias --add @embed $USERDATA_DIR/models/text_encoder && \
civitconfig alias --add @checkpoint $USERDATA_DIR/models/Stable-diffusion && \
/app/webui/webui.sh --gradio-allowed-path \".\" --data-dir $USERDATA_DIR $ARGS" ]
su webui -c \"/app/webui/webui.sh --gradio-allowed-path . --data-dir $USERDATA_DIR $ARGS\""]

0 comments on commit 4e73597

Please sign in to comment.