FROM python:3.13-slim RUN apt-get update && apt-get install -y build-essential RUN useradd -m -u 1000 user USER user ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory WORKDIR $HOME/app # Update pip to the latest version RUN pip install --upgrade pip RUN pip install -U setuptools wheel # Install torch cpu version RUN pip install -U torch torchvision torchaudio # Copy the requirements file into the container COPY --chown=user requirements.txt . # Install the dependencies RUN pip install -U --no-cache-dir -r requirements.txt # Copy the rest of the application code into the container COPY --chown=user . . EXPOSE 7860 ENTRYPOINT ["fastapi", "run", "main.py", "--host=0.0.0.0", "--port=7860"]