2022-09-05 17:51:22 +00:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
2022-11-20 10:35:56 +00:00
|
|
|
FROM python:3.10-slim
|
2022-09-05 17:51:22 +00:00
|
|
|
|
|
|
|
SHELL ["/bin/bash", "-ceuxo", "pipefail"]
|
|
|
|
|
2022-10-29 20:02:35 +00:00
|
|
|
ENV DEBIAN_FRONTEND=noninteractive PIP_EXISTS_ACTION=w PIP_PREFER_BINARY=1 PIP_NO_CACHE_DIR=1
|
2022-09-11 18:18:50 +00:00
|
|
|
|
2022-09-05 17:51:22 +00:00
|
|
|
|
2022-11-20 10:35:56 +00:00
|
|
|
RUN pip install torch==1.13.0 torchvision --extra-index-url https://download.pytorch.org/whl/cu117
|
|
|
|
|
|
|
|
RUN apt-get update && apt-get install git -y && apt-get clean
|
|
|
|
|
|
|
|
RUN git clone https://github.com/invoke-ai/InvokeAI.git /stable-diffusion
|
|
|
|
|
|
|
|
WORKDIR /stable-diffusion
|
2022-09-05 17:51:22 +00:00
|
|
|
|
|
|
|
RUN <<EOF
|
2022-11-20 10:35:56 +00:00
|
|
|
git reset --hard 2b7e3abe57963d199f1d825ddef87ae154c81045
|
2022-10-07 07:46:07 +00:00
|
|
|
git config --global http.postBuffer 1048576000
|
2022-11-20 10:35:56 +00:00
|
|
|
ln -sf environments-and-requirements/requirements-lin-cuda.txt requirements.txt
|
|
|
|
pip install -r requirements.txt
|
2022-09-05 17:51:22 +00:00
|
|
|
EOF
|
|
|
|
|
|
|
|
|
2022-11-20 10:35:56 +00:00
|
|
|
ARG BRANCH=development SHA=2b7e3abe57963d199f1d825ddef87ae154c81045
|
2022-09-16 14:40:20 +00:00
|
|
|
RUN <<EOF
|
|
|
|
git fetch
|
2022-09-19 20:02:46 +00:00
|
|
|
git reset --hard
|
2022-09-16 14:40:20 +00:00
|
|
|
git checkout ${BRANCH}
|
|
|
|
git reset --hard ${SHA}
|
2022-11-20 10:35:56 +00:00
|
|
|
pip install -r requirements.txt
|
2022-09-16 14:40:20 +00:00
|
|
|
EOF
|
|
|
|
|
2022-11-04 21:35:44 +00:00
|
|
|
RUN pip uninstall opencv-python -y && pip install --force-reinstall opencv-python-headless==4.5.5.64
|
2022-09-16 14:40:20 +00:00
|
|
|
|
|
|
|
COPY . /docker/
|
2022-09-19 20:02:46 +00:00
|
|
|
RUN <<EOF
|
2022-10-07 07:46:07 +00:00
|
|
|
python3 /docker/info.py /stable-diffusion/frontend/dist/index.html
|
2022-09-19 20:02:46 +00:00
|
|
|
EOF
|
|
|
|
|
2022-09-05 17:51:22 +00:00
|
|
|
|
2022-11-20 10:35:56 +00:00
|
|
|
ENV ROOT=/stable-diffusion PRELOAD=false CLI_ARGS=""
|
2022-09-05 17:51:22 +00:00
|
|
|
EXPOSE 7860
|
2022-09-16 14:40:20 +00:00
|
|
|
|
2022-11-04 21:35:44 +00:00
|
|
|
|
|
|
|
ENTRYPOINT ["/docker/entrypoint.sh"]
|
|
|
|
CMD python3 -u scripts/invoke.py --outdir /output --web --host 0.0.0.0 --port 7860 ${CLI_ARGS}
|