diff --git a/Dockerfile b/Dockerfile index 3be3959..154ea2e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -49,8 +49,12 @@ COPY pyproject.toml uv.lock README.md ./ COPY pixelle_video ./pixelle_video # Install Python dependencies using uv with configurable index URL -# Auto-select Aliyun mirror when USE_CN_MIRROR=true and UV_INDEX_URL is default +# Auto-select China mirror when USE_CN_MIRROR=true and UV_INDEX_URL is default +# Set longer timeout and reduce concurrent downloads for stability RUN if [ "$USE_CN_MIRROR" = "true" ] && [ "$UV_INDEX_URL" = "https://pypi.org/simple" ]; then \ + export UV_HTTP_TIMEOUT=300 && \ + export UV_CONCURRENT_DOWNLOADS=2 && \ + uv sync --frozen --no-dev --index-url https://pypi.tuna.tsinghua.edu.cn/simple/ || \ uv sync --frozen --no-dev --index-url https://mirrors.aliyun.com/pypi/simple/; \ else \ uv sync --frozen --no-dev --index-url $UV_INDEX_URL; \ diff --git a/docker-compose.yml b/docker-compose.yml index 46768ed..9adb201 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -3,14 +3,14 @@ version: '3.8' # Build Arguments Configuration # You can override these by setting environment variables before running docker-compose # -# Example for China environment (auto uses Aliyun mirrors): +# Example for China environment (auto uses Tsinghua/Aliyun mirrors): # USE_CN_MIRROR=true docker-compose up -d # # Example for international environment (default): # docker-compose up -d # # Advanced: Use custom PyPI mirror: -# USE_CN_MIRROR=true UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/ docker-compose up -d +# UV_INDEX_URL=https://mirrors.cloud.tencent.com/pypi/simple/ docker-compose up -d services: # API Service - FastAPI backend