# Use Python 3.12 image as specified in user global rules FROM python:3.12-slim # Create a non-root user RUN useradd -m -u 1000 user USER user ENV PATH="/home/user/.local/bin:$PATH" WORKDIR /app # Copy requirements and install COPY --chown=user ./requirements.txt requirements.txt RUN pip install --no-cache-dir --upgrade -r requirements.txt # Copy the rest of the application COPY --chown=user . /app # Expose the mandatory Hugging Face port EXPOSE 7860 # Run with uvicorn on port 7860 CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]