Skip to content

Commit

Permalink
> fix image
Browse files Browse the repository at this point in the history
  • Loading branch information
kebe7jun committed Jan 8, 2025
1 parent b588c09 commit cb06096
Showing 1 changed file with 19 additions and 17 deletions.
36 changes: 19 additions & 17 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,25 +17,27 @@ ENV venv_dir -

RUN useradd -U --home /stable-diffusion-webui sd

RUN pip install -r requirements.txt --no-cache-dir && \
chown -R sd:sd /stable-diffusion-webui

# RUN sh -c 'nohup ./webui.sh -f --skip-torch-cuda-test --no-half >/tmp/sd.log &'; \
# start=$(date +%s); \
# while true; do \
# sleep 3; \
# if grep -q "Applying attention optimization" /tmp/sd.log; then \
# break; \
# elif ! ps -ef | grep -q ./webui.sh; then \
# cat /tmp/sd.log; \
# exit 11; \
# else \
# echo "[$(($(date +%s)-${start}))s] preparing..."; \
# fi; \
# done && \
# rm -rf /root/.cache /tmp/sd.log && \
# RUN pip install -r requirements.txt --no-cache-dir && \
# chown -R sd:sd /stable-diffusion-webui

RUN awk '/KEEP_GOING=1/ {flag=1} flag' webui.sh > /tmp/build.sh && \
sh -c "nohup bash webui.sh -f --skip-torch-cuda-test --no-half >/tmp/sd.log &"; \
start=$(date +%s); \
while true; do \
sleep 3; \
if grep -q "python venv already activate" /tmp/sd.log; then \
break; \
elif ! ps -ef | grep -q ./webui.sh; then \
cat /tmp/sd.log; \
exit 11; \
else \
echo "[$(($(date +%s)-${start}))s] preparing..."; \
fi; \
done && \
rm -rf /root/.cache /tmp/sd.log && \
chown -R sd:sd /stable-diffusion-webui && \
cat /tmp/build.sh >> webui.sh

EXPOSE 7860

USER sd
Expand Down

0 comments on commit cb06096

Please sign in to comment.