|
|
|
FROM python:3.11-slim AS builder |
|
|
|
WORKDIR /app |
|
|
|
|
|
RUN apt-get update && apt-get install -y \ |
|
curl \ |
|
build-essential \ |
|
pkg-config \ |
|
&& rm -rf /var/lib/apt/lists/* \ |
|
&& curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y \ |
|
&& . $HOME/.cargo/env |
|
|
|
|
|
COPY requirements.txt . |
|
COPY lightrag/api/requirements.txt ./lightrag/api/ |
|
|
|
|
|
ENV PATH="/root/.cargo/bin:${PATH}" |
|
RUN pip install --user --no-cache-dir -r requirements.txt |
|
RUN pip install --user --no-cache-dir -r lightrag/api/requirements.txt |
|
|
|
|
|
RUN pip install --user --no-cache-dir nano-vectordb networkx |
|
|
|
RUN pip install --user --no-cache-dir openai ollama tiktoken |
|
|
|
RUN pip install --user --no-cache-dir pypdf2 python-docx python-pptx openpyxl |
|
|
|
|
|
FROM python:3.11-slim |
|
|
|
WORKDIR /app |
|
|
|
|
|
COPY --from=builder /root/.local /root/.local |
|
COPY ./lightrag ./lightrag |
|
COPY setup.py . |
|
|
|
RUN pip install ".[api]" |
|
|
|
ENV PATH=/root/.local/bin:$PATH |
|
|
|
|
|
RUN mkdir -p /app/data/rag_storage /app/data/inputs |
|
|
|
|
|
ENV WORKING_DIR=/app/data/rag_storage |
|
ENV INPUT_DIR=/app/data/inputs |
|
|
|
|
|
EXPOSE 9621 |
|
|
|
|
|
ENTRYPOINT ["python", "-m", "lightrag.api.lightrag_server"] |
|
|