zerovic commited on
Commit
b7773e6
·
verified ·
1 Parent(s): 42be7e2

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +7 -11
Dockerfile CHANGED
@@ -1,32 +1,28 @@
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
14
  WORKDIR /app
15
 
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"]
 
 
1
  FROM python:3.10-slim
2
 
3
  # Install system dependencies
 
4
  RUN apt-get update && apt-get install -y \
5
  libgl1 \
6
  libglib2.0-0 \
7
  git \
 
8
  && rm -rf /var/lib/apt/lists/*
9
 
 
10
  WORKDIR /app
11
 
12
+ # 1. Force install CPU-only version of Torch first
13
+ # This prevents pip from trying to download the 5GB+ NVIDIA drivers
14
+ RUN pip install --no-cache-dir torch torchvision --index-url https://download.pytorch.org/whl/cpu
15
+
16
+ # 2. Clone the repo
17
  RUN git clone https://github.com/rupeshs/fastsdcpu.git .
18
 
19
+ # 3. Install requirements but skip the heavy torch/cuda resolution
20
+ # We use --no-deps or specific constraints to keep the build fast
21
  RUN pip install --no-cache-dir -r requirements.txt
22
  RUN pip install --no-cache-dir openvino-dev fastapi uvicorn
23
 
 
 
 
24
  # Hugging Face Spaces run on port 7860
25
  EXPOSE 7860
26
 
27
  # Command to start the web UI
 
28
  CMD ["python3", "src/app.py", "--host", "0.0.0.0", "--port", "7860"]