File size: 787 Bytes
4e09904
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
FROM python:3.11-slim

RUN apt-get update && apt-get install -y --no-install-recommends \
    curl ca-certificates unzip libgomp1 && rm -rf /var/lib/apt/lists/*

WORKDIR /app
RUN pip install --no-cache-dir fastapi==0.115.6 uvicorn==0.34.0 pydantic==2.10.4

# stable-diffusion.cpp CPU build
RUN mkdir -p /app/bin && cd /tmp && \
    curl -sL -o sd.zip https://github.com/leejet/stable-diffusion.cpp/releases/download/master-913-b167b94/sd-master-b167b94-bin-Linux-Ubuntu-24.04-x86_64.zip && \
    unzip -q sd.zip -d /app/bin && chmod +x /app/bin/sd-cli || true

COPY app.py index.html /app/
RUN mkdir -p /app/models /app/outputs /app/static

ENV SD_BIN=/app/bin/sd-cli
ENV LD_LIBRARY_PATH=/app/bin
ENV SD_THREADS=8
EXPOSE 7860
CMD ["uvicorn","app:app","--host","0.0.0.0","--port","7860"]