bookSearchLLM / Dockerfile
Alopmel's picture
Update Dockerfile
cac01e0 verified
Raw History Blame Contribute Delete
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"]