LightRAG/Dockerfile

36 lines
827 B
Docker
Raw Normal View History

2025-01-16 22:28:28 +01:00
# Build stage
FROM python:3.11-slim as builder
WORKDIR /app
# Copy only requirements files first to leverage Docker cache
COPY requirements.txt .
COPY lightrag/api/requirements.txt ./lightrag/api/
# Install dependencies
RUN pip install --user --no-cache-dir -r requirements.txt
RUN pip install --user --no-cache-dir -r lightrag/api/requirements.txt
# Final stage
FROM python:3.11-slim
WORKDIR /app
# Copy only necessary files from builder
COPY --from=builder /root/.local /root/.local
2025-01-17 02:31:23 +01:00
COPY ./lightrag ./lightrag
COPY setup.py .
2025-01-16 22:28:28 +01:00
2025-01-17 02:31:23 +01:00
RUN pip install .
2025-01-16 22:28:28 +01:00
# Make sure scripts in .local are usable
ENV PATH=/root/.local/bin:$PATH
# Create necessary directories
RUN mkdir -p /app/data/rag_storage /app/data/inputs
# Expose the default port
EXPOSE 9621
# Set entrypoint
ENTRYPOINT ["python", "-m", "lightrag.api.lightrag_server"]