改为使用uv安装,更加快速,且修复torch和transformers未安装的问题

改为使用uv安装,更加快速,且修复torch和transformers未安装的问题
This commit is contained in:
Doiiars
2025-10-30 14:13:34 +08:00
committed by BaiFu
parent 7eec3a104b
commit 1d714d443e
+7 -2
View File
@@ -34,12 +34,17 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
ffmpeg \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
# Install uv and expose it on PATH
ENV PATH="/root/.local/bin:${PATH}"
RUN curl -LsSf https://astral.sh/uv/install.sh | sh
WORKDIR /app
# Install Python dependencies first to leverage Docker layer caching
COPY requirements.txt ./
RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
RUN uv pip install --system -r requirements.txt && \
uv pip install --system torch torchvision torchaudio && \
uv pip install --system transformers scikit-learn xgboost && \
python -m playwright install chromium
# Copy application source