Download Dockerfile from um41r/Text-Api: direct link, hf CLI and curl.
- Browser
- Download file 571 Bytes
-
https://huggingface.co/spaces/um41r/Text-Api/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/um41r/Text-Api/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/um41r/Text-Api/resolve/main/Dockerfile
571 Bytes
| FROM python:3.11-slim | |
| # HuggingFace Spaces runs as user 1000 | |
| RUN useradd -m -u 1000 user | |
| WORKDIR /app | |
| # System deps | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential curl && \ | |
| rm -rf /var/lib/apt/lists/* | |
| # Install Python deps as root first (faster layer caching) | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| # Copy app source | |
| COPY --chown=user . . | |
| # HF Spaces exposes port 7860 | |
| ENV PORT=7860 | |
| EXPOSE 7860 | |
| USER user | |
| CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"] | |