From 9ea92e5aa718d695d9e884093348239fd5ec3ee2 Mon Sep 17 00:00:00 2001 From: puke <1129090915@qq.com> Date: Wed, 19 Nov 2025 00:29:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=94=B9Docker=E7=9A=84=E9=95=9C?= =?UTF-8?q?=E5=83=8F=E5=9C=B0=E5=9D=80?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Dockerfile | 10 +++++----- docker-compose.yml | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index d5a8043..de47a52 100644 --- a/Dockerfile +++ b/Dockerfile @@ -7,7 +7,7 @@ FROM python:3.11-slim # USE_CN_MIRROR: whether to use China mirrors (true/false) # UV_INDEX_URL: Python package index URL (defaults to Aliyun when USE_CN_MIRROR=true) ARG USE_CN_MIRROR=false -ARG UV_INDEX_URL=https://pypi.org/simple +ARG UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple # Set working directory WORKDIR /app @@ -36,7 +36,7 @@ RUN apt-get update && apt-get install -y \ # For China: use pip to install uv from mirror (faster and more stable) # For International: use official installer script RUN if [ "$USE_CN_MIRROR" = "true" ]; then \ - pip install --no-cache-dir -i https://mirrors.aliyun.com/pypi/simple/ uv; \ + pip install --no-cache-dir -i https://pypi.tuna.tsinghua.edu.cn/simple/ uv; \ else \ curl -LsSf https://astral.sh/uv/install.sh | sh; \ fi @@ -52,10 +52,10 @@ COPY pixelle_video ./pixelle_video # Auto-select China mirror when USE_CN_MIRROR=true and UV_INDEX_URL is default # Set longer timeout and reduce concurrent downloads for stability # IMPORTANT: UV requires BOTH environment variable AND --index-url for proper mirror usage -RUN if [ "$USE_CN_MIRROR" = "true" ] && [ "$UV_INDEX_URL" = "https://pypi.org/simple" ]; then \ +RUN if [ "$USE_CN_MIRROR" = "true" ] && [ "$UV_INDEX_URL" = "https://pypi.tuna.tsinghua.edu.cn/simple" ]; then \ export UV_HTTP_TIMEOUT=300 && \ - export UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ && \ - export UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/ && \ + export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/ && \ + export UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ && \ uv sync --frozen --no-dev; \ else \ export UV_HTTP_TIMEOUT=300 && \ diff --git a/docker-compose.yml b/docker-compose.yml index 5c96b16..b871c5f 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -20,7 +20,7 @@ services: dockerfile: Dockerfile args: USE_CN_MIRROR: ${USE_CN_MIRROR:-false} - UV_INDEX_URL: ${UV_INDEX_URL:-https://pypi.org/simple} + UV_INDEX_URL: ${UV_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple} container_name: pixelle-video-api command: uv run python api/app.py --host 0.0.0.0 --port 8000 ports: @@ -59,7 +59,7 @@ services: dockerfile: Dockerfile args: USE_CN_MIRROR: ${USE_CN_MIRROR:-false} - UV_INDEX_URL: ${UV_INDEX_URL:-https://pypi.org/simple} + UV_INDEX_URL: ${UV_INDEX_URL:-https://pypi.tuna.tsinghua.edu.cn/simple} container_name: pixelle-video-web command: uv run streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0 ports: