Spaces:
Running
Running
File size: 856 Bytes
e609c58 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | FROM python:3.10-slim
# System dependencies for OpenCV, ffmpeg, and video processing
RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
libgl1 \
libglib2.0-0 \
libsm6 \
libxext6 \
libxrender1 \
&& rm -rf /var/lib/apt/lists/*
# Create non-root user (required by HF Spaces)
RUN useradd -m -u 1000 user
ENV HOME=/home/user \
PATH=/home/user/.local/bin:$PATH \
PYTHONUNBUFFERED=1 \
TF_CPP_MIN_LOG_LEVEL=2
WORKDIR /app
# Install Python dependencies
COPY requirements.txt .
RUN pip install --no-cache-dir -r requirements.txt
# Copy application code
COPY App/ .
# Copy model files
COPY tmp_checkpoint/best_model.keras models/best_model.keras
# Create uploads directory with proper permissions
RUN mkdir -p uploads && chown -R user:user /app
USER user
EXPOSE 7860
CMD ["python", "app.py"]
|