# Use the official Python 3.10 image FROM python:3.10-slim # Hugging Face requires the container to run as user 1000 RUN useradd -m -u 1000 user USER user # Set up environment variables ENV HOME=/home/user \ PATH=/home/user/.local/bin:$PATH # Set the working directory WORKDIR $HOME/app # Copy your app files into the container COPY --chown=user . $HOME/app # Upgrade pip and install the requirements RUN pip install --no-cache-dir --upgrade pip && \ pip install --no-cache-dir -r requirements.txt # Expose the standard Hugging Face Spaces port EXPOSE 7860 # Boot up the FastAPI server # NOTE: If your server file is named app.py, change "main:app" to "app:app" CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]