-
Notifications
You must be signed in to change notification settings - Fork 167
Expand file tree
/
Copy pathDockerfile
More file actions
50 lines (38 loc) · 1.93 KB
/
Copy pathDockerfile
File metadata and controls
50 lines (38 loc) · 1.93 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# ---------------------------------------------------------------------------- #
# Stage 1: Download the models #
# ---------------------------------------------------------------------------- #
FROM alpine/git:2.43.0 as download
# NOTE: CivitAI usually requires an API token, so you need to add it in the header
# of the wget command if you're using a model from CivitAI.
RUN apk add --no-cache wget && \
wget -q -O /model.safetensors https://huggingface.co/XpucT/Deliberate/resolve/main/Deliberate_v6.safetensors
# ---------------------------------------------------------------------------- #
# Stage 2: Build the final image #
# ---------------------------------------------------------------------------- #
FROM python:3.10.14-slim as build_final_image
ARG A1111_RELEASE=v1.9.3
ENV DEBIAN_FRONTEND=noninteractive \
PIP_PREFER_BINARY=1 \
ROOT=/stable-diffusion-webui \
PYTHONUNBUFFERED=1
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update && \
apt install -y \
fonts-dejavu-core rsync git jq moreutils aria2 wget libgoogle-perftools-dev libtcmalloc-minimal4 procps libgl1 libglib2.0-0 && \
apt-get autoremove -y && rm -rf /var/lib/apt/lists/* && apt-get clean -y
RUN --mount=type=cache,target=/root/.cache/pip \
git clone https://github.com/AUTOMATIC1111/stable-diffusion-webui.git && \
cd stable-diffusion-webui && \
git reset --hard ${A1111_RELEASE} && \
pip install xformers && \
pip install -r requirements_versions.txt && \
python -c "from launch import prepare_environment; prepare_environment()" --skip-torch-cuda-test
COPY --from=download /model.safetensors /model.safetensors
# install dependencies
COPY requirements.txt .
RUN --mount=type=cache,target=/root/.cache/pip \
pip install --no-cache-dir -r requirements.txt
COPY test_input.json .
ADD src .
RUN chmod +x /start.sh
CMD /start.sh