Spaces:
Build error
Build error
Update Dockerfile
Browse files- Dockerfile +12 -5
Dockerfile
CHANGED
|
@@ -1,11 +1,13 @@
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
-
# Install system dependencies
|
|
|
|
| 5 |
RUN apt-get update && apt-get install -y \
|
| 6 |
-
libgl1
|
| 7 |
libglib2.0-0 \
|
| 8 |
git \
|
|
|
|
| 9 |
&& rm -rf /var/lib/apt/lists/*
|
| 10 |
|
| 11 |
# Set working directory
|
|
@@ -14,12 +16,17 @@ WORKDIR /app
|
|
| 14 |
# Clone the FastSD CPU repository
|
| 15 |
RUN git clone https://github.com/rupeshs/fastsdcpu.git .
|
| 16 |
|
| 17 |
-
# Install dependencies
|
|
|
|
| 18 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 19 |
-
RUN pip install --no-cache-dir openvino-dev
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
# Hugging Face Spaces run on port 7860
|
| 22 |
EXPOSE 7860
|
| 23 |
|
| 24 |
-
# Command to start the web UI
|
|
|
|
| 25 |
CMD ["python3", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]
|
|
|
|
| 1 |
# Use a lightweight Python image
|
| 2 |
FROM python:3.10-slim
|
| 3 |
|
| 4 |
+
# Install system dependencies
|
| 5 |
+
# Note: libgl1 is the updated replacement for libgl1-mesa-glx
|
| 6 |
RUN apt-get update && apt-get install -y \
|
| 7 |
+
libgl1 \
|
| 8 |
libglib2.0-0 \
|
| 9 |
git \
|
| 10 |
+
python3-pip \
|
| 11 |
&& rm -rf /var/lib/apt/lists/*
|
| 12 |
|
| 13 |
# Set working directory
|
|
|
|
| 16 |
# Clone the FastSD CPU repository
|
| 17 |
RUN git clone https://github.com/rupeshs/fastsdcpu.git .
|
| 18 |
|
| 19 |
+
# Install dependencies
|
| 20 |
+
# We add 'fastapi' and 'uvicorn' to ensure the web server layers work well in a container
|
| 21 |
RUN pip install --no-cache-dir -r requirements.txt
|
| 22 |
+
RUN pip install --no-cache-dir openvino-dev fastapi uvicorn
|
| 23 |
+
|
| 24 |
+
# Set environment variable to skip the opening of a browser window (prevents crashes in Docker)
|
| 25 |
+
ENV SD_WEBUI_RELOAD=1
|
| 26 |
|
| 27 |
# Hugging Face Spaces run on port 7860
|
| 28 |
EXPOSE 7860
|
| 29 |
|
| 30 |
+
# Command to start the web UI
|
| 31 |
+
# Added --browser false to ensure it doesn't try to launch a window inside the container
|
| 32 |
CMD ["python3", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]
|