diff --git a/Dockerfile b/Dockerfile index c52f1ab3..edc6addb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,13 +1,23 @@ # Build stage -FROM python:3.11-slim as builder +FROM python:3.11-slim AS builder WORKDIR /app +# Install Rust and required build dependencies +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 only requirements files first to leverage Docker cache COPY requirements.txt . COPY lightrag/api/requirements.txt ./lightrag/api/ # Install dependencies +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 @@ -28,6 +38,10 @@ ENV PATH=/root/.local/bin:$PATH # Create necessary directories RUN mkdir -p /app/data/rag_storage /app/data/inputs +# Docker data directories +ENV WORKING_DIR=/app/data/rag_storage +ENV INPUT_DIR=/app/data/inputs + # Expose the default port EXPOSE 9621 diff --git a/lightrag/api/requirements.txt b/lightrag/api/requirements.txt index 0e8e246b..f1662004 100644 --- a/lightrag/api/requirements.txt +++ b/lightrag/api/requirements.txt @@ -18,3 +18,4 @@ pytz tenacity tiktoken uvicorn +graspologic>=3.4.1