FROM python:3.9 RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH WORKDIR $HOME/app ENV TRANSFORMERS_CACHE=$HOME/app/.cache ENV HUGGINGFACE_HUB_CACHE=$HOME/app/.cache RUN chmod 777 $HOME/app/.cache COPY ./requirements.txt $HOME/app/requirements.txt RUN apt-get update && apt-get install ffmpeg libsm6 libxext6 -y -y RUN pip install --no-cache-dir --upgrade -r $HOME/app/requirements.txt COPY --chown=user . $HOME/app CMD ["python", "$HOME/app/main.py"]