rag-vietnamese / Dockerfile
thaidinhz1's picture
fix: rebuild BM25 index from Qdrant if pkl not found
538d976
Raw History Blame
705 Bytes
FROM python:3.11-slim
WORKDIR /app
# Cài system deps cho underthesea + EasyOCR
RUN apt-get update && apt-get install -y \
gcc g++ git libgl1 libglib2.0-0 \
&& rm -rf /var/lib/apt/lists/*
# Cài Python deps trước (cache layer)
COPY requirements.txt .
RUN pip install --no-cache-dir --trusted-host pypi.org --trusted-host files.pythonhosted.org --timeout 300 -r requirements.txt
# Copy source code
COPY src/ ./src/
COPY static/ ./static/
COPY api.py .
# Model sẽ được download tự động lần đầu chạy
# Qdrant storage và BM25 index mount từ volume
VOLUME ["/app/qdrant_storage", "/app/data"]
EXPOSE 7860
CMD ["uvicorn", "api:app", "--host", "0.0.0.0", "--port", "7860"]