FROM python:3.10-slim WORKDIR /app # Install system dependencies for OpenCV RUN apt-get update && apt-get install -y \ libgl1 \ libglib2.0-0 \ wget \ ca-certificates \ && rm -rf /var/lib/apt/lists/* # Copy requirements and install Python dependencies COPY requirements.txt . RUN pip install --no-cache-dir -r requirements.txt # Download the MediaPipe model file RUN wget -q -O hand_landmarker.task https://storage.googleapis.com/mediapipe-models/hand_landmarker/hand_landmarker/float16/latest/hand_landmarker.task # Copy the application code COPY . . # Expose the port Streamlit runs on (HF Spaces uses 7860) EXPOSE 7860 # Run the application CMD ["streamlit", "run", "app.py", "--server.port", "7860", "--server.address", "0.0.0.0", "--server.enableCORS", "false", "--server.enableXsrfProtection", "false"]