MisbahKhan/R2-Tuning
0
1# Use an official Python runtime as the base image2FROM python:3.9-slim3 4# Install system dependencies as root (including git for cloning repositories)5RUN apt-get update && apt-get install -y \6 libavformat-dev libavcodec-dev libavdevice-dev libavutil-dev \7 libswscale-dev libswresample-dev libavfilter-dev \8 git \9 && rm -rf /var/lib/apt/lists/*10 11# Create a non-root user (Hugging Face Spaces requirement)12RUN useradd -m -u 1000 user13USER user14WORKDIR /app15ENV PATH="/home/user/.local/bin:$PATH"16 17# Copy requirements.txt and install dependencies18COPY --chown=user ./requirements.txt requirements.txt19RUN pip install --no-cache-dir --upgrade -r requirements.txt20 21# Copy the rest of the application files22COPY --chown=user . /app23 24# Expose the port (Hugging Face Spaces default is 7860)25EXPOSE 786026 27# Command to run the FastAPI app with Uvicorn28CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]