This commit is contained in:
2026-01-09 08:46:01 +08:00
parent d5b75fee0d
commit f3f1609455
6 changed files with 135 additions and 54 deletions

View File

@@ -37,8 +37,8 @@ ENV BUILD_NO_SERVER=true \
WORKDIR /label-studio/web
# Fix Docker Arm64 Build
RUN yarn config set registry https://registry.npmjs.org/
# 配置 yarn 淘宝镜像
RUN yarn config set registry https://registry.npmmirror.com/
RUN yarn config set network-timeout 1200000 # HTTP timeout used when downloading packages, set to 20 minutes
# [修改] 从 downloader 阶段复制 package.json 和 lock 文件
@@ -85,12 +85,18 @@ ENV PYTHONUNBUFFERED=1 \
POETRY_VIRTUALENVS_PREFER_ACTIVE_PYTHON=true \
PATH="/opt/poetry/bin:$PATH"
# 配置 pip 阿里云镜像
RUN pip config set global.index-url https://mirrors.aliyun.com/pypi/simple/ && \
pip config set global.trusted-host mirrors.aliyun.com
ADD https://install.python-poetry.org /tmp/install-poetry.py
RUN python /tmp/install-poetry.py
# 配置 apt 阿里云镜像源
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
set -eux; \
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources; \
apt-get update; \
apt-get install --no-install-recommends -y \
build-essential git; \
@@ -147,10 +153,11 @@ ENV LS_DIR=/label-studio \
WORKDIR $LS_DIR
# install prerequisites for app
# 配置 apt 阿里云镜像源并安装应用依赖
RUN --mount=type=cache,target=/var/cache/apt,sharing=locked \
--mount=type=cache,target=/var/lib/apt/lists,sharing=locked \
set -eux; \
sed -i 's/deb.debian.org/mirrors.aliyun.com/g' /etc/apt/sources.list.d/debian.sources; \
apt-get update; \
apt-get upgrade -y; \
apt-get install --no-install-recommends -y libexpat1 libgl1 libglx-mesa0 libglib2.0-0t64 \