FROM python:3.11-slim # Install FFmpeg and required packages # unrar-free + p7zip-full -> /leech archive extraction (.rar / .7z) # mediainfo -> proper industry-standard MediaInfo CLI output (used by upload_mediainfo) RUN apt-get update -y && apt-get upgrade -y \ && apt-get install -y --no-install-recommends ffmpeg unrar-free p7zip-full mediainfo megatools \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* # Set up user to run the application (HuggingFace requirement for security) RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" WORKDIR /app # Copy requirement and install COPY --chown=user requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy all source files COPY --chown=user . /app # HuggingFace standard port mapping ENV PORT=7860 ENV WEBHOOK=True CMD ["python", "-u", "bot.py"]