FROM python:3.10-slim # Set environment variables ENV HOME /app ENV PATH="/usr/local/bin:$PATH" # Create and set working directory WORKDIR /app # Copy requirement files COPY requirements.txt . # Install dependencies RUN pip install --no-cache-dir -r requirements.txt # Copy application files (app.py and model weights) # IMPORTANT: All your model files (config.json, model.safetensors, etc.) # MUST be uploaded to the root of your Hugging Face repo alongside this Dockerfile. COPY . . # Set the command to run the FastAPI application # This is the standard, reliable entry point for FastAPI on Hugging Face Spaces. CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860"]