Spaces:
Running
Running
Download Dockerfile from Alopmel/bookSearchLLM: direct link, hf CLI and curl.
- Browser
- Download file 764 Bytes
-
https://huggingface.co/spaces/Alopmel/bookSearchLLM/resolve/main/Dockerfile
- Command line
-
hf download hf://spaces/Alopmel/bookSearchLLM/Dockerfile
-
curl -L -o Dockerfile https://huggingface.co/spaces/Alopmel/bookSearchLLM/resolve/main/Dockerfile
764 Bytes
| FROM python:3.11-slim | |
| ENV PIP_NO_CACHE_DIR=1 \ | |
| HF_HOME=/app/.cache/huggingface \ | |
| HUGGINGFACE_HUB_CACHE=/app/.cache/huggingface \ | |
| UVICORN_WORKERS=1 \ | |
| OMP_NUM_THREADS=1 | |
| WORKDIR /app | |
| COPY requirements.txt ./ | |
| RUN pip install --no-cache-dir -r requirements.txt | |
| ##(opcional) precalentar modelos para evitar cold-start | |
| RUN python - <<'PY' | |
| from fastembed import TextEmbedding | |
| TextEmbedding("sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2") | |
| from sentence_transformers import SentenceTransformer | |
| SentenceTransformer("sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2") | |
| print("Modelos precargados ✅") | |
| PY | |
| COPY . . | |
| EXPOSE 7860 | |
| CMD ["python", "-m", "uvicorn", "app.main:app", "--host", "0.0.0.0", "--port", "7860", "--workers", "1"] | |