diff --git a/api/Dockerfile b/api/Dockerfile index cff696ff56..303d9ff4ef 100644 --- a/api/Dockerfile +++ b/api/Dockerfile @@ -5,21 +5,24 @@ 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 pip install --no-cache-dir uv==${UV_VERSION} +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/ +# 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 +79,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 diff --git a/web/Dockerfile b/web/Dockerfile index dfc5ba8b46..ef6443febb 100644 --- a/web/Dockerfile +++ b/web/Dockerfile @@ -10,6 +10,8 @@ RUN npm install -g pnpm@10.8.0 ENV PNPM_HOME="/pnpm" ENV PATH="$PNPM_HOME:$PATH" +# if you located in China, you can use taobao mirror to speed up +# RUN pnpm config set registry https://registry.npmmirror.com/ # install packages FROM base AS packages @@ -73,4 +75,4 @@ ENV COMMIT_SHA=${COMMIT_SHA} USER 1001 EXPOSE 3000 -ENTRYPOINT ["/bin/sh", "./entrypoint.sh"] +ENTRYPOINT ["/bin/sh", "./entrypoint.sh"] \ No newline at end of file