rafiaashraf commited on
Commit
0b4afc7
·
verified ·
1 Parent(s): 510c00e

Update Dockerfile

Browse files
Files changed (1) hide show
  1. Dockerfile +38 -25
Dockerfile CHANGED
@@ -1,25 +1,38 @@
1
- FROM python:3.10-slim
2
-
3
- # Install system dependencies
4
- RUN apt-get update && apt-get install -y \
5
- ffmpeg \
6
- libsm6 \
7
- libxext6 \
8
- libgl1-mesa-glx \
9
- && rm -rf /var/lib/apt/lists/*
10
-
11
- # Set working directory
12
- WORKDIR /app
13
-
14
- # Copy files
15
- COPY . /app
16
-
17
- # Install dependencies
18
- RUN pip install --upgrade pip
19
- RUN pip install -r requirements.txt
20
-
21
- # Expose port
22
- EXPOSE 7860
23
-
24
- # Run Flask app
25
- CMD ["python", "app.py"]
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Use a compatible Python base image
2
+ FROM python:3.10-slim
3
+
4
+ # Set working directory
5
+ WORKDIR /app
6
+
7
+ # Copy files
8
+ COPY . .
9
+
10
+ # Install system dependencies
11
+ RUN apt-get update && apt-get install -y \
12
+ wget \
13
+ ffmpeg \
14
+ libgl1 \
15
+ && rm -rf /var/lib/apt/lists/*
16
+
17
+ # Install Python dependencies
18
+ RUN pip install --no-cache-dir -r requirements.txt
19
+
20
+ # Create writable dirs for matplotlib, fontconfig, and mediapipe models
21
+ RUN mkdir -p /tmp/mplconfig /app/.cache/fontconfig /app/models/mediapipe && \
22
+ chmod -R 777 /tmp/mplconfig /app/.cache /app/models
23
+
24
+ # Download mediapipe model to a writable path
25
+ RUN wget -O /app/models/pose_landmark_heavy.tflite \
26
+ https://storage.googleapis.com/mediapipe-assets/pose_landmark_heavy.tflite
27
+
28
+ # Set environment variables
29
+ ENV MPLCONFIGDIR=/tmp/mplconfig
30
+ ENV XDG_CACHE_HOME=/app/.cache
31
+ ENV FONTCONFIG_PATH=/etc/fonts
32
+ ENV HOME=/app
33
+
34
+ # Expose the port used by Flask
35
+ EXPOSE 7860
36
+
37
+ # Command to run the app
38
+ CMD ["python", "app.py"]