Upgrade Python to 3.12 and update pip/setuptools in Dockerfile

• Upgrade base image to Python 3.12
• Update pip, setuptools, wheel
This commit is contained in:
yangdx 2025-08-23 23:38:39 +08:00
parent bac946fd98
commit b815e47f7c

View file

@ -1,8 +1,11 @@
# Build stage # Build stage
FROM python:3.11-slim AS builder FROM python:3.12-slim AS builder
WORKDIR /app WORKDIR /app
# Upgrade pip、setuptools and wheel to the latest version
RUN pip install --upgrade pip setuptools wheel
# Install Rust and required build dependencies # Install Rust and required build dependencies
RUN apt-get update && apt-get install -y \ RUN apt-get update && apt-get install -y \
curl \ curl \
@ -30,10 +33,13 @@ RUN pip install --user --no-cache-dir openai ollama tiktoken
RUN pip install --user --no-cache-dir pypdf2 python-docx python-pptx openpyxl RUN pip install --user --no-cache-dir pypdf2 python-docx python-pptx openpyxl
# Final stage # Final stage
FROM python:3.11-slim FROM python:3.12-slim
WORKDIR /app WORKDIR /app
# Upgrade pip and setuptools
RUN pip install --upgrade pip setuptools wheel
# Copy only necessary files from builder # Copy only necessary files from builder
COPY --from=builder /root/.local /root/.local COPY --from=builder /root/.local /root/.local
COPY ./lightrag ./lightrag COPY ./lightrag ./lightrag