From 341cc77a7927e9a91532f788087172b216df9a3a Mon Sep 17 00:00:00 2001 From: "tao.chen" <93983997+taochen-ct@users.noreply.github.com> Date: Fri, 14 Aug 2026 16:02:19 +0800 Subject: [PATCH] update: Dockerfile --- backend/Dockerfile | 15 +++++++++------ runtime/Dockerfile | 7 ++++++- schedule/Dockerfile | 6 +++++- 3 files changed, 20 insertions(+), 8 deletions(-) diff --git a/backend/Dockerfile b/backend/Dockerfile index 434cc8e..aa4f12e 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,16 +1,19 @@ FROM python-base:3.12 +ENV UV_HTTP_TIMEOUT=300 +ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ + +COPY common/pyproject.toml common/pyproject.toml +COPY backend/pyproject.toml backend/pyproject.toml +COPY pyproject.toml uv.lock ./ +RUN uv sync --no-dev --package backend --no-install-workspace + + COPY common ./common COPY backend ./backend COPY alembic.ini ./ COPY migrations ./migrations -COPY pyproject.toml uv.lock ./ -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 --no-install-workspace EXPOSE 8000 CMD ["gunicorn", "--config", "backend/gunicorn.conf.py", "backend.main:app"] diff --git a/runtime/Dockerfile b/runtime/Dockerfile index 2da5c1e..598c1d9 100644 --- a/runtime/Dockerfile +++ b/runtime/Dockerfile @@ -6,11 +6,16 @@ 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 + COPY pyproject.toml uv.lock ./ +COPY common/pyproject.toml common/pyproject.toml +COPY runtime/pyproject.toml runtime/pyproject.toml +RUN uv sync --frozen --no-dev --package runtime --no-install-workspace + COPY common ./common COPY runtime ./runtime COPY extras ./extras -RUN uv sync --frozen --no-dev --no-editable --package runtime --no-install-workspace +RUN uv sync --frozen --no-dev --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 && \ diff --git a/schedule/Dockerfile b/schedule/Dockerfile index 17c301a..c0ba867 100644 --- a/schedule/Dockerfile +++ b/schedule/Dockerfile @@ -4,10 +4,14 @@ ENV UV_HTTP_TIMEOUT=300 ENV UV_DEFAULT_INDEX=https://pypi.tuna.tsinghua.edu.cn/simple/ COPY pyproject.toml uv.lock ./ +COPY common/pyproject.toml common/pyproject.toml +COPY schedule/pyproject.toml schedule/pyproject.toml +RUN uv sync --frozen --no-dev --package schedule --no-install-workspace + COPY common ./common COPY schedule ./schedule COPY extras ./extras -RUN uv sync --frozen --no-dev --no-editable --package schedule --no-install-workspace +RUN uv sync --frozen --no-dev --package schedule RUN uv venv --python 3.12 /opt/venv/python3.12 && \ uv pip install --python /opt/venv/python3.12/bin/python -r extras/requirements-py312 && \