Spaces:
Runtime error
Runtime error
# Use a compatible Python base image | |
FROM python:3.10-slim | |
# Set working directory | |
WORKDIR /app | |
# Copy files | |
COPY . . | |
# Install system dependencies | |
RUN apt-get update && apt-get install -y \ | |
wget \ | |
ffmpeg \ | |
libgl1 \ | |
&& rm -rf /var/lib/apt/lists/* | |
# Install Python dependencies | |
RUN pip install --no-cache-dir -r requirements.txt | |
# Create writable dirs for matplotlib, fontconfig, and mediapipe models | |
RUN mkdir -p /tmp/mplconfig /app/.cache/fontconfig /app/models/mediapipe && \ | |
chmod -R 777 /tmp/mplconfig /app/.cache /app/models | |
# Download mediapipe model to a writable path | |
RUN wget -O /app/models/pose_landmark_heavy.tflite \ | |
https://storage.googleapis.com/mediapipe-assets/pose_landmark_heavy.tflite | |
# Set environment variables | |
ENV MPLCONFIGDIR=/tmp/mplconfig | |
ENV XDG_CACHE_HOME=/app/.cache | |
ENV FONTCONFIG_PATH=/etc/fonts | |
ENV HOME=/app | |
# Expose the port used by Flask | |
EXPOSE 8000 | |
# Command to run the app | |
CMD ["python", "app.py"] | |