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