优化国内docker部署的镜像逻辑

This commit is contained in:
puke
2025-11-21 01:08:40 +08:00
parent 3d4aea3b11
commit d018e24fd3

View File

@@ -46,16 +46,14 @@ RUN uv --version
COPY pyproject.toml uv.lock README.md ./ COPY pyproject.toml uv.lock README.md ./
COPY pixelle_video ./pixelle_video COPY pixelle_video ./pixelle_video
# Install Python dependencies using uv with configurable index URL # Install Python dependencies using uv pip install
# Create uv.toml config file to force using the mirror (most reliable method) # Use -i flag to specify mirror when USE_CN_MIRROR=true
# Only create config when USE_CN_MIRROR=true, otherwise use default PyPI RUN export UV_HTTP_TIMEOUT=300 && \
RUN if [ "$USE_CN_MIRROR" = "true" ]; then \ if [ "$USE_CN_MIRROR" = "true" ]; then \
echo '[[index]]' > uv.toml && \ uv pip install -e . -i https://pypi.tuna.tsinghua.edu.cn/simple; \
echo 'url = "https://pypi.tuna.tsinghua.edu.cn/simple"' >> uv.toml && \ else \
echo 'default = true' >> uv.toml; \ uv pip install -e .; \
fi && \ fi
export UV_HTTP_TIMEOUT=300 && \
uv sync --frozen --no-dev
# Copy rest of application code # Copy rest of application code
COPY api ./api COPY api ./api