FROM python:3.10 RUN useradd -m -u 1000 user WORKDIR /app # Install system dependencies and any Python requirements COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Clone transformers repo and install it RUN git clone https://github.com/huggingface/transformers RUN cd transformers && pip install . # Now copy the rest of your application COPY --chown=user . /app # Set the correct entrypoint CMD ["uvicorn", "index:app", "--host", "0.0.0.0", "--port", "7860"]