FROM python:3.12-slim # Create working directory RUN mkdir -p /app # Create and set user RUN useradd -u 1000 -d /app -UM appuser # Install ffmpeg RUN apt-get update \ && apt-get install -y ffmpeg \ && apt-get clean # Chown appuser home RUN chown -R appuser:appuser /app && chmod 750 /app # Switch to appuser USER appuser # Set the working directory WORKDIR /app # Ensure pip RUN python -m ensurepip # Upgrade pip RUN pip install --upgrade pip # Install requirements COPY requirements.txt /app/requirements.txt RUN pip install -r /app/requirements.txt # Copy the sort.py file to the working directory COPY sort.py /app/sort.py # Set the entry point to sort.py ENTRYPOINT ["python", "/app/sort.py"]