更改Docker的镜像地址

This commit is contained in:
puke
2025-11-19 00:29:16 +08:00
parent 05fba73035
commit 9ea92e5aa7
2 changed files with 7 additions and 7 deletions

View File

@@ -7,7 +7,7 @@ FROM python:3.11-slim
# USE_CN_MIRROR: whether to use China mirrors (true/false) # 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) # UV_INDEX_URL: Python package index URL (defaults to Aliyun when USE_CN_MIRROR=true)
ARG USE_CN_MIRROR=false 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 # Set working directory
WORKDIR /app 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 China: use pip to install uv from mirror (faster and more stable)
# For International: use official installer script # For International: use official installer script
RUN if [ "$USE_CN_MIRROR" = "true" ]; then \ 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 \ else \
curl -LsSf https://astral.sh/uv/install.sh | sh; \ curl -LsSf https://astral.sh/uv/install.sh | sh; \
fi 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 # Auto-select China mirror when USE_CN_MIRROR=true and UV_INDEX_URL is default
# Set longer timeout and reduce concurrent downloads for stability # Set longer timeout and reduce concurrent downloads for stability
# IMPORTANT: UV requires BOTH environment variable AND --index-url for proper mirror usage # 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_HTTP_TIMEOUT=300 && \
export UV_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ && \ export UV_INDEX_URL=https://pypi.tuna.tsinghua.edu.cn/simple/ && \
export UV_DEFAULT_INDEX=https://mirrors.aliyun.com/pypi/simple/ && \ export UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ && \
uv sync --frozen --no-dev; \ uv sync --frozen --no-dev; \
else \ else \
export UV_HTTP_TIMEOUT=300 && \ export UV_HTTP_TIMEOUT=300 && \

View File

@@ -20,7 +20,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
USE_CN_MIRROR: ${USE_CN_MIRROR:-false} 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 container_name: pixelle-video-api
command: uv run python api/app.py --host 0.0.0.0 --port 8000 command: uv run python api/app.py --host 0.0.0.0 --port 8000
ports: ports:
@@ -59,7 +59,7 @@ services:
dockerfile: Dockerfile dockerfile: Dockerfile
args: args:
USE_CN_MIRROR: ${USE_CN_MIRROR:-false} 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 container_name: pixelle-video-web
command: uv run streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0 command: uv run streamlit run web/app.py --server.port 8501 --server.address 0.0.0.0
ports: ports: