POCKET-Zimage-CPU / Dockerfile
SeaWolf-AI's picture
Add CPU-only image Space (FastAPI + i18n UI)
4e09904 verified
Raw History Blame Contribute Delete
787 Bytes
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"]