Dockerfile 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. # syntax=docker/dockerfile:1
  2. FROM continuumio/miniconda3:4.12.0
  3. SHELL ["/bin/bash", "-ceuxo", "pipefail"]
  4. ENV DEBIAN_FRONTEND=noninteractive
  5. # now it requires python3.9
  6. RUN conda install python=3.9 && conda clean -a -y
  7. RUN conda install pytorch==1.11.0 torchvision==0.12.0 cudatoolkit=11.3 -c pytorch && conda clean -a -y
  8. RUN apt-get update && apt install fonts-dejavu-core rsync gcc -y && apt-get clean
  9. RUN <<EOF
  10. git clone https://github.com/invoke-ai/InvokeAI.git stable-diffusion
  11. cd stable-diffusion
  12. git reset --hard a1739a73b48bfe98b6abcb67f5a0197a9ad270e0
  13. sed -i -- 's/python=3.8.5/python=3.9/g' environment.yaml
  14. conda env update --file environment.yaml -n base
  15. conda clean -a -y
  16. EOF
  17. ARG BRANCH=development SHA=8c9f2ae705cf723d4a8a73c416e8d8bf2d746977
  18. # this breaks on generation:
  19. # there is a new UI anyway, but it is not by any means ready.
  20. # ARG BRANCH=development SHA=bdbc76fcd4bd3362312dc91b087d9af66de423b1
  21. RUN <<EOF
  22. cd stable-diffusion
  23. git fetch
  24. git reset --hard
  25. git checkout ${BRANCH}
  26. git reset --hard ${SHA}
  27. conda env update --file environment.yml -n base
  28. conda clean -a -y
  29. EOF
  30. RUN pip uninstall opencv-python -y && pip install --prefer-binary --force-reinstall --no-cache-dir opencv-python-headless transformers==4.19.2
  31. COPY . /docker/
  32. RUN <<EOF
  33. python3 /docker/info.py /stable-diffusion/static/dream_web/index.html
  34. chmod +x /docker/mount.sh
  35. sed -i -- 's/outputs\//\/output/g' /stable-diffusion/backend/server.py
  36. EOF
  37. ENV TRANSFORMERS_CACHE=/cache/transformers TORCH_HOME=/cache/torch PRELOAD=false CLI_ARGS=""
  38. WORKDIR /stable-diffusion
  39. EXPOSE 7860
  40. CMD /docker/mount.sh && \
  41. # python3 -u backend/server.py --host 0.0.0.0 --port 7860 --cors http://localhost:7860
  42. # python3 -u scripts/dream.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}
  43. echo The lstein webUI is currently deactivated due to implementation limitations: \
  44. https://github.com/invoke-ai/InvokeAI/blob/8c9f2ae705cf723d4a8a73c416e8d8bf2d746977/backend/modules/create_cmd_parser.py#L26 \
  45. Once the path the output is fixed, the UI will be activated again