FROM python:3.9-slim WORKDIR /code COPY ./requirements.txt /code/requirements.txt # Install dependencies RUN pip install --no-cache-dir --upgrade -r /code/requirements.txt # Copy all files COPY . /code # Change permissions to allow writing if needed by SHAP or any library (HF requires 777 for non-root) RUN chmod -R 777 /code # Set host and port for Hugging Face space CMD ["uvicorn", "main:app", "--host", "0.0.0.0", "--port", "7860"]