|
|
|
FROM python:3.12 |
|
|
|
|
|
WORKDIR /app/rag-system |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
build-essential \ |
|
libpoppler-cpp-dev \ |
|
wget \ |
|
&& apt-get clean \ |
|
&& rm -rf /var/lib/apt/lists/* |
|
|
|
RUN pip install torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cpu |
|
|
|
|
|
|
|
RUN pip install --no-cache-dir poetry |
|
|
|
|
|
COPY poetry.lock pyproject.toml /app/ |
|
COPY rag-system /app/rag-system/ |
|
|
|
|
|
ENV PYTHONPATH=/app/rag-system/src |
|
ENV TOKENIZERS_PARALLELISM=false |
|
ENV TORCH_CPP_LOG_LEVEL=ERROR |
|
ENV PYTORCH_DISABLE_SYSTEM_MONITORING=1 |
|
|
|
|
|
RUN poetry config virtualenvs.create false |
|
|
|
|
|
RUN poetry install --no-root --no-dev |
|
|
|
|
|
RUN python3 -m src.preprocessing |
|
|
|
|
|
EXPOSE 7860 |
|
|
|
|
|
CMD ["python3", "app.py"] |
|
|