Spaces:
Sleeping
Sleeping
File size: 889 Bytes
ec0daf5 14010e5 ec0daf5 | 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 | # Use official Python 3.10 slim image
FROM python:3.10-slim
# Install system dependencies
RUN apt-get update && apt-get install -y \
ffmpeg \
libgl1 \
libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Set working directory
WORKDIR /app
# Create a non-root user for Hugging Face Spaces
RUN useradd -m -u 1000 user
USER user
ENV PATH="/home/user/.local/bin:${PATH}"
# Copy requirements and install
COPY --chown=user:user requirements.txt .
RUN pip install --no-cache-dir --user -r requirements.txt
# Copy the rest of the application
COPY --chown=user:user . .
# Create uploads directory structure explicitly to ensure permissions
RUN mkdir -p uploads/models uploads/videos uploads/results uploads/temp
# Set environment variables
ENV PORT=7860
ENV PYTHONUNBUFFERED=1
# Expose the application port
EXPOSE 7860
# Command to run the application
CMD ["python", "main.py"]
|