From 43241b85cf20e898697cb1e01400f553926691f6 Mon Sep 17 00:00:00 2001 From: Jamie Pine Date: Tue, 3 Feb 2026 04:11:27 -0800 Subject: [PATCH] Update Dockerfile to install Python 3.12 venv and bootstrap pip - Replaced python3-pip with python3.12-venv in the installation process. - Added commands to ensure pip is upgraded and installed after setting Python 3.12 as the default. - Streamlined the installation of PyTorch by removing redundant pip upgrade command. --- Dockerfile.cuda | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile.cuda b/Dockerfile.cuda index c03001fa..b7d7ca96 100644 --- a/Dockerfile.cuda +++ b/Dockerfile.cuda @@ -15,15 +15,17 @@ RUN apt-get update && apt-get install -y \ && apt-get update && apt-get install -y \ python3.12 \ python3.12-dev \ - python3-pip \ + python3.12-venv \ ffmpeg \ curl \ tzdata \ && rm -rf /var/lib/apt/lists/* -# Set Python 3.12 as default +# Set Python 3.12 as default and bootstrap pip RUN update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.12 1 && \ - update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 + update-alternatives --install /usr/bin/python python /usr/bin/python3.12 1 && \ + python3.12 -m ensurepip --upgrade && \ + python3.12 -m pip install --upgrade pip # Copy backend COPY backend/ /app/backend/ @@ -33,8 +35,7 @@ COPY providers/ /app/providers/ COPY web/dist/ /app/web/dist/ # Install PyTorch with CUDA support first -RUN python -m pip install --upgrade pip && \ - pip install --no-cache-dir \ +RUN pip install --no-cache-dir \ torch torchvision torchaudio --index-url https://download.pytorch.org/whl/cu121 # Install remaining dependencies