Spaces:
Paused
Paused
Download Dockerfile from dosesnrolls1/Cpubatch: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/dosesnrolls1/Cpubatch/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/dosesnrolls1/Cpubatch/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/dosesnrolls1/Cpubatch/resolve/main/Dockerfile
1.2 kB
| FROM python:3.11-slim-bookworm AS engine | |
| RUN apt-get update && apt-get install -y --no-install-recommends git cmake build-essential ca-certificates && rm -rf /var/lib/apt/lists/* | |
| ARG SD_CPP_REF=master | |
| RUN git clone https://github.com/leejet/stable-diffusion.cpp /src && cd /src && git checkout "$SD_CPP_REF" && git submodule update --init --recursive && git rev-parse HEAD > /engine-commit.txt | |
| RUN cmake -S /src -B /src/build -DCMAKE_BUILD_TYPE=Release -DBUILD_SHARED_LIBS=OFF -DGGML_NATIVE=OFF -DSD_CUDA=OFF -DSD_VULKAN=OFF -DSD_METAL=OFF && cmake --build /src/build --target sd-cli -j2 | |
| FROM python:3.11-slim-bookworm | |
| RUN apt-get update && apt-get install -y --no-install-recommends libgomp1 libstdc++6 ca-certificates && rm -rf /var/lib/apt/lists/* | |
| RUN useradd -m -u 1000 user | |
| COPY --from=engine /src/build/bin/sd-cli /usr/local/bin/sd-cli | |
| COPY --from=engine /engine-commit.txt /engine-commit.txt | |
| WORKDIR /app | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY --chown=user:user . . | |
| USER user | |
| ENV HOME=/home/user HF_HOME=/home/user/.cache/huggingface PYTHONUNBUFFERED=1 GRADIO_SERVER_NAME=0.0.0.0 GRADIO_SERVER_PORT=7860 CPU_THREADS=2 | |
| EXPOSE 7860 | |
| CMD ["python", "app.py"] | |