Spaces:
Sleeping
Sleeping
| # Dockerfile for Hugging Face Spaces (FastAPI) | |
| FROM python:3.9 | |
| # create unprivileged user per HF recommendations | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /app | |
| # copy and install requirements | |
| COPY --chown=user ./requirements.txt requirements.txt | |
| RUN pip install --no-cache-dir --upgrade -r requirements.txt | |
| # copy app files | |
| COPY --chown=user . /app | |
| # run uvicorn on port 7860 (HF expects this port) | |
| CMD ["uvicorn", "app:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |