1+ # syntax=docker/dockerfile:1
2+
13# Frontend build stage
24FROM oven/bun:1 AS frontend-builder
35
@@ -7,7 +9,8 @@ WORKDIR /app
79COPY lightrag_webui/ ./lightrag_webui/
810
911# Build frontend assets for inclusion in the API package
10- RUN cd lightrag_webui \
12+ RUN --mount=type=cache,target=/root/.bun/install/cache \
13+ cd lightrag_webui \
1114 && bun install --frozen-lockfile \
1215 && bun run build
1316
@@ -40,7 +43,8 @@ COPY setup.py .
4043COPY uv.lock .
4144
4245# Install base, API, and offline extras without the project to improve caching
43- RUN uv sync --frozen --no-dev --extra api --extra offline --no-install-project --no-editable
46+ RUN --mount=type=cache,target=/root/.local/share/uv \
47+ uv sync --frozen --no-dev --extra api --extra offline --no-install-project --no-editable
4448
4549# Copy project sources after dependency layer
4650COPY lightrag/ ./lightrag/
@@ -49,7 +53,8 @@ COPY lightrag/ ./lightrag/
4953COPY --from=frontend-builder /app/lightrag/api/webui ./lightrag/api/webui
5054
5155# Sync project in non-editable mode and ensure pip is available for runtime installs
52- RUN uv sync --frozen --no-dev --extra api --extra offline --no-editable \
56+ RUN --mount=type=cache,target=/root/.local/share/uv \
57+ uv sync --frozen --no-dev --extra api --extra offline --no-editable \
5358 && /app/.venv/bin/python -m ensurepip --upgrade
5459
5560# Prepare offline cache directory and pre-populate tiktoken data
@@ -81,7 +86,8 @@ ENV PATH=/app/.venv/bin:/root/.local/bin:$PATH
8186
8287# Install dependencies with uv sync (uses locked versions from uv.lock)
8388# And ensure pip is available for runtime installs
84- RUN uv sync --frozen --no-dev --extra api --extra offline --no-editable \
89+ RUN --mount=type=cache,target=/root/.local/share/uv \
90+ uv sync --frozen --no-dev --extra api --extra offline --no-editable \
8591 && /app/.venv/bin/python -m ensurepip --upgrade
8692
8793# Create persistent data directories AFTER package installation
0 commit comments