Spaces:
Runtime error
Runtime error
Update Dockerfile
Browse files- Dockerfile +38 -25
Dockerfile
CHANGED
@@ -1,25 +1,38 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
# Install dependencies
|
18 |
-
RUN pip install --
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
#
|
25 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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"]
|