From af9466c4e65ed569acac291bac62c65e421df9c8 Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Fri, 14 Aug 2026 15:27:16 +0800 Subject: [PATCH] update: UV_HTTP_TIMEOUT --- backend/Dockerfile | 8 ++++++-- runtime/Dockerfile | 8 ++++---- schedule/Dockerfile | 8 ++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 398351e..b26cff0 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -5,8 +5,12 @@ COPY backend ./backend COPY alembic.ini ./ COPY migrations ./migrations COPY pyproject.toml uv.lock ./ -RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv lock && \ - UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --no-dev --no-editable --package backend + +ENV UV_HTTP_TIMEOUT=300 +ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ + +RUN uv lock && \ + uv sync --no-dev --no-editable --package backend EXPOSE 8000 CMD ["gunicorn", "--config", "backend/gunicorn.conf.py", "backend.main:app"] diff --git a/runtime/Dockerfile b/runtime/Dockerfile index c3aff99..6a38be7 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -1,5 +1,8 @@ FROM python-base:3.12 +ENV UV_HTTP_TIMEOUT=300 +ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ + # 从官方 Rclone 镜像直接复制 rclone 二进制文件(高效、稳定) COPY --from=rclone/rclone:latest /usr/local/bin/rclone /usr/local/bin/rclone @@ -7,14 +10,13 @@ COPY pyproject.toml uv.lock ./ COPY common ./common COPY runtime ./runtime COPY extras ./extras -RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package runtime +RUN uv sync --frozen --no-dev --no-editable --package runtime RUN mkdir -p /root/.jupyter/custom /app/.venv/share/jupyter/custom && \ echo '#top-panel, #top-panel-wrapper, .jp-Notebook-header, .jp-FileEditorHeader {display: none !important; height: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: none !important; position: absolute !important; pointer-events: none !important; }' > /root/.jupyter/custom/custom.css && \ cp /root/.jupyter/custom/custom.css /app/.venv/share/jupyter/custom/custom.css RUN uv venv --seed --python 3.8 /opt/venv/python3.8 && \ - UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ \ uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \ /opt/venv/python3.8/bin/python -m ipykernel install \ --prefix=/usr/local \ @@ -22,7 +24,6 @@ RUN uv venv --seed --python 3.8 /opt/venv/python3.8 && \ --display-name="Python 3.8" RUN uv venv --seed --python 3.10 /opt/venv/python3.10 && \ - UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ \ uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \ /opt/venv/python3.10/bin/python -m ipykernel install \ --prefix=/usr/local \ @@ -30,7 +31,6 @@ RUN uv venv --seed --python 3.10 /opt/venv/python3.10 && \ --display-name="Python 3.10" RUN uv venv --seed --python 3.12 /opt/venv/python3.12 && \ - UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ \ uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 && \ /opt/venv/python3.12/bin/python -m ipykernel install \ --prefix=/usr/local \ diff --git a/schedule/Dockerfile b/schedule/Dockerfile index 5da85a2..6583ec0 100644 --- a/schedule/Dockerfile +++ b/schedule/Dockerfile @@ -1,13 +1,15 @@ FROM python-base:3.12 +ENV UV_HTTP_TIMEOUT=300 +ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ + COPY pyproject.toml uv.lock ./ COPY common ./common COPY schedule ./schedule COPY extras ./extras -RUN UV_DEFAULT_INDEX="https://pypi.tuna.tsinghua.edu.cn/simple/" uv sync --frozen --no-dev --no-editable --package schedule +RUN uv sync --frozen --no-dev --no-editable --package schedule RUN uv venv --python 3.12 /opt/venv/python3.12 && \ - UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ \ uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 && \ /opt/venv/python3.12/bin/python -m ipykernel install \ --prefix=/usr/local \ @@ -15,7 +17,6 @@ RUN uv venv --python 3.12 /opt/venv/python3.12 && \ --display-name="Python 3.12" RUN uv venv --python 3.10 /opt/venv/python3.10 && \ - UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ \ uv pip install --python /opt/venv/python3.10/bin/python -r extras/requirements-py310 && \ /opt/venv/python3.10/bin/python -m ipykernel install \ --prefix=/usr/local \ @@ -23,7 +24,6 @@ RUN uv venv --python 3.10 /opt/venv/python3.10 && \ --display-name="Python 3.10" RUN uv venv --python 3.8 /opt/venv/python3.8 && \ - UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ \ uv pip install --python /opt/venv/python3.8/bin/python -r extras/requirements-py38 && \ /opt/venv/python3.8/bin/python -m ipykernel install \ --prefix=/usr/local \