Spaces:
Running
Running
Download Dockerfile from nvikou/polyglot-rag: direct link, hf CLI and curl.
- Browser
- Download file 1.12 kB
-
https://huggingface.co/spaces/nvikou/polyglot-rag/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/nvikou/polyglot-rag/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/nvikou/polyglot-rag/resolve/main/Dockerfile
1.12 kB
| # PolyglotRAG — image Docker de production. | |
| # Compatible : exécution locale (docker run / docker compose) ET | |
| # Hugging Face Spaces en SDK "docker" (README.md: sdk: docker, app_port: 7860). | |
| FROM python:3.11-slim | |
| ENV PYTHONDONTWRITEBYTECODE=1 \ | |
| PYTHONUNBUFFERED=1 \ | |
| PIP_NO_CACHE_DIR=1 \ | |
| GRADIO_ANALYTICS_ENABLED=False \ | |
| PORT=7860 | |
| WORKDIR /app | |
| # Dépendances système minimales : libgomp1 pour faiss-cpu, build-essential | |
| # pour compiler les rares roues non pré-buildées (arm64 notamment). | |
| RUN apt-get update && apt-get install -y --no-install-recommends \ | |
| build-essential \ | |
| libgomp1 \ | |
| curl \ | |
| && rm -rf /var/lib/apt/lists/* | |
| COPY requirements.txt . | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| COPY . . | |
| # Hugging Face Spaces (SDK docker) exige un utilisateur non-root (UID 1000). | |
| RUN useradd -m -u 1000 appuser \ | |
| && mkdir -p /app/data \ | |
| && chown -R appuser:appuser /app | |
| USER appuser | |
| EXPOSE 7860 | |
| HEALTHCHECK --interval=30s --timeout=5s --start-period=20s --retries=3 \ | |
| CMD curl -fsS "http://127.0.0.1:${PORT}/" || exit 1 | |
| CMD ["python", "app.py"] | |