FROM linuxserver/ffmpeg:7.1.1
LABEL authors="Jerry Yan"

RUN sed -i 's@//.*archive.ubuntu.com@//mirrors.ustc.edu.cn@g' /etc/apt/sources.list && \
    sed -i 's/security.ubuntu.com/mirrors.ustc.edu.cn/g' /etc/apt/sources.list
RUN apt-get update && \
    apt-get install -y --no-install-recommends \
      python3-pip \
      python3-dev \
      python3-setuptools \
      python3-wheel \
      python3-venv
RUN apt-get clean && \
    rm -rf /var/lib/apt/lists/*
COPY . /app/
RUN python3 -m venv /app/venv
RUN /app/venv/bin/python -m pip config set global.index-url https://mirrors.ustc.edu.cn/pypi/simple
RUN /app/venv/bin/python -m pip install -r /app/requirements.txt

WORKDIR /app
ENTRYPOINT ["/app/venv/bin/python", "app.py"]