sidmaz666 commited on
Commit
f2f3018
·
verified ·
1 Parent(s): 49a8215

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +4 -16
Dockerfile CHANGED
@@ -1,10 +1,8 @@
1
- # Use a slim Python base image
2
  FROM python:3.11-slim
3
 
4
- # Set the working directory
5
  WORKDIR /app
6
 
7
- # Install system dependencies
8
  RUN apt-get update && apt-get install -y \
9
  libgomp1 \
10
  libglib2.0-0 \
@@ -12,26 +10,16 @@ RUN apt-get update && apt-get install -y \
12
  wget \
13
  && rm -rf /var/lib/apt/lists/*
14
 
15
- # Copy requirements first for better caching
16
  COPY requirements.txt .
17
-
18
- # Install Python dependencies
19
  RUN pip install --no-cache-dir -r requirements.txt
20
 
21
- # Create directories for models
22
  RUN mkdir -p /app/models/loras
23
 
24
- # Pre-download the PyTorch LCM model during build
25
- RUN python -c "from diffusers import DiffusionPipeline; \
26
- pipe = DiffusionPipeline.from_pretrained('SimianLuo/LCM_Dreamshaper_v7', \
27
- torch_dtype=torch.float32, safety_checker=None); \
28
- pipe.to('cpu')"
29
-
30
- # Copy the application code
31
  COPY app.py .
32
 
33
- # Expose the port Hugging Face Spaces uses
34
  EXPOSE 7860
35
 
36
- # Command to run the FastAPI application
37
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]
 
 
1
  FROM python:3.11-slim
2
 
 
3
  WORKDIR /app
4
 
5
+ # Install minimal system dependencies
6
  RUN apt-get update && apt-get install -y \
7
  libgomp1 \
8
  libglib2.0-0 \
 
10
  wget \
11
  && rm -rf /var/lib/apt/lists/*
12
 
13
+ # Copy and install Python dependencies
14
  COPY requirements.txt .
 
 
15
  RUN pip install --no-cache-dir -r requirements.txt
16
 
17
+ # Create directory for LoRAs
18
  RUN mkdir -p /app/models/loras
19
 
20
+ # Copy the FastAPI application
 
 
 
 
 
 
21
  COPY app.py .
22
 
 
23
  EXPOSE 7860
24
 
 
25
  CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]