Download Dockerfile from shravanda/ExtraaLearnLeadBackend: direct link, hf CLI and curl.
- Browser
- Download file 682 Bytes
-
https://huggingface.co/spaces/shravanda/ExtraaLearnLeadBackend/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/shravanda/ExtraaLearnLeadBackend/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/shravanda/ExtraaLearnLeadBackend/resolve/main/Dockerfile
682 Bytes
| # Lightweight Python base image | |
| FROM python:3.12-slim | |
| # Hugging Face Docker spaces run the container as a non-root user with UID 1000 | |
| RUN useradd -m -u 1000 user | |
| USER user | |
| ENV PATH="/home/user/.local/bin:$PATH" | |
| WORKDIR /home/user/app | |
| # Install dependencies first so Docker can cache this layer | |
| COPY --chown=user requirements.txt . | |
| RUN pip install --no-cache-dir --upgrade pip && pip install --no-cache-dir -r requirements.txt | |
| # Copy the API code and the serialized model | |
| COPY --chown=user . . | |
| # Serve the Flask app with gunicorn on port 7860 (the port Hugging Face exposes) | |
| EXPOSE 7860 | |
| CMD ["gunicorn", "--workers", "2", "--bind", "0.0.0.0:7860", "--timeout", "120", "app:app"] | |