yukee1992 commited on
Commit
dd114c2
·
verified ·
1 Parent(s): d1f6b24

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +5 -32
Dockerfile CHANGED
@@ -1,39 +1,12 @@
1
- # Use Python 3.10 slim image for compatibility with torch 2.1.0
2
- FROM python:3.10-slim
3
 
4
- # Set working directory
5
  WORKDIR /app
6
-
7
- # Install system dependencies required for torch, diffusers, and image processing
8
- RUN apt-get update && apt-get install -y \
9
- git \
10
- git-lfs \
11
- ffmpeg \
12
- libsm6 \
13
- libxext6 \
14
- cmake \
15
- rsync \
16
- libgl1 \
17
- libglib2.0-0 \
18
- && rm -rf /var/lib/apt/lists/* \
19
- && git lfs install
20
-
21
- # Upgrade pip and install Python dependencies
22
  COPY requirements.txt .
23
- RUN pip install --no-cache-dir --upgrade pip && \
24
- pip install --no-cache-dir -r requirements.txt
25
 
26
- # Copy application code
27
  COPY . .
28
 
29
- # Create directory for local image backups
30
- RUN mkdir -p generated_images_backup
31
-
32
- # Expose the port Hugging Face expects
33
- EXPOSE 7860
34
-
35
- # Set environment variables
36
- ENV PYTHONUNBUFFERED=1
37
 
38
- # Run the application
39
- CMD ["python", "app.py"]
 
1
+ FROM python:3.9
 
2
 
 
3
  WORKDIR /app
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  COPY requirements.txt .
5
+ RUN pip install -r requirements.txt
 
6
 
 
7
  COPY . .
8
 
9
+ # Expose both ports
10
+ EXPOSE 8000 7860
 
 
 
 
 
 
11
 
12
+ CMD ["python", "app.py"