From d3b5901406d002459d72aefea0afddc0f1c0d925 Mon Sep 17 00:00:00 2001 From: lska367 <53926324+lska367@users.noreply.github.com> Date: Sat, 19 Apr 2025 20:40:46 +0800 Subject: [PATCH] fix #18406 --- api/Dockerfile | 14 +++++++++----- api/sources.list | 13 +++++++++++++ 2 files changed, 22 insertions(+), 5 deletions(-) create mode 100644 api/sources.list diff --git a/api/Dockerfile b/api/Dockerfile index cff696ff56..df7f67785b 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,21 +5,25 @@ WORKDIR /app/api # Install uv ENV UV_VERSION=0.6.14 +# if you are located in China,you can add the sentence to acceding uv pip tool +# ENV UV_DEFAULT_INDEX="https://mirrors.aliyun.com/pypi/simple/" +# RUN python -m pip install -i https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple --upgrade pip +# RUN pip install --no-cache-dir uv==${UV_VERSION} -i https://mirrors.aliyun.com/pypi/simple/ RUN pip install --no-cache-dir uv==${UV_VERSION} +# if you meet some error about apt,you can try to use sources.list config apt images +# RUN rm -rf /etc/apt/source* +# ADD sources.list /etc/apt/ FROM base AS packages -# if you located in China, you can use aliyun mirror to speed up -# RUN sed -i 's@deb.debian.org@mirrors.aliyun.com@g' /etc/apt/sources.list.d/debian.sources - RUN apt-get update \ && apt-get install -y --no-install-recommends gcc g++ libc-dev libffi-dev libgmp-dev libmpfr-dev libmpc-dev # Install Python dependencies COPY pyproject.toml uv.lock ./ -RUN uv sync --locked +RUN uv lock && uv sync --locked # production stage FROM base AS production @@ -76,4 +80,4 @@ RUN chmod +x /entrypoint.sh ARG COMMIT_SHA ENV COMMIT_SHA=${COMMIT_SHA} -ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] +ENTRYPOINT ["/bin/bash", "/entrypoint.sh"] \ No newline at end of file diff --git a/api/sources.list b/api/sources.list new file mode 100644 index 0000000000..ba608d3f7e --- /dev/null +++ b/api/sources.list @@ -0,0 +1,13 @@ +# 默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释 +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware +deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-free non-free-firmware + +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware +deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-free non-free-firmware + +deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware +deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-free non-free-firmware + +# 以下安全更新软件源包含了官方源与镜像站配置,如有需要可自行修改注释切换 +# deb https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware +# deb-src https://security.debian.org/debian-security bookworm-security main contrib non-free non-free-firmware \ No newline at end of file