yukee1992 commited on
Commit
88d7cb8
·
verified ·
1 Parent(s): c60d631

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +26 -5
Dockerfile CHANGED
@@ -1,12 +1,33 @@
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"
 
 
1
+ FROM python:3.9-slim
2
 
3
  WORKDIR /app
4
+
5
+ # Install system dependencies
6
+ RUN apt-get update && apt-get install -y \
7
+ git \
8
+ git-lfs \
9
+ ffmpeg \
10
+ libsm6 \
11
+ libxext6 \
12
+ cmake \
13
+ rsync \
14
+ libgl1 \
15
+ && rm -rf /var/lib/apt/lists/* \
16
+ && git lfs install
17
+
18
+ # Copy requirements first for better caching
19
  COPY requirements.txt .
20
+ RUN pip install --no-cache-dir --upgrade pip && \
21
+ pip install --no-cache-dir -r requirements.txt
22
 
23
+ # Copy the rest of the app
24
  COPY . .
25
 
26
+ # Create necessary directories
27
+ RUN mkdir -p generated_test_images model_cache
28
+
29
+ # Expose port
30
+ EXPOSE 7860
31
 
32
+ # Use exec form to avoid shell interpretation issues
33
+ CMD ["python", "app.py"]