laring-backend / Dockerfile
Zaid
chore: run download_models.py during Docker build step
dce82c6
Raw
History Blame Contribute Delete
754 Bytes
# Use official Python 3.10 slim image
FROM python:3.10-slim
# Install system dependencies for OpenCV, MediaPipe, and Git
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
libgl1 \
libglib2.0-0 \
libgles2 \
libegl1 \
libgbm1 \
git \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Copy requirements and install
COPY backend/requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy all backend files
COPY backend/ .
# Download AI/MediaPipe models
RUN python download_models.py
# Expose port (Hugging Face Spaces uses 7860 by default)
EXPOSE 7860
# Run the FastAPI server
CMD ["uvicorn", "server:app", "--host", "0.0.0.0", "--port", "7860"]