优化下载速度, 配置镜像站-2

This commit is contained in:
yml
2026-04-08 17:09:31 +08:00
parent 1c3e306e36
commit 92970780a4
3 changed files with 6 additions and 5 deletions
+4 -3
View File
@@ -4,7 +4,6 @@ ARG DEBIAN_MIRROR=mirrors.cloud.tencent.com
ARG NPM_REGISTRY=https://registry.npmmirror.com
ARG PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright
ARG UV_DEFAULT_INDEX=https://mirrors.cloud.tencent.com/pypi/simple
ARG TARGETARCH
ENV DEBIAN_FRONTEND=noninteractive
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
@@ -28,8 +27,10 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
COPY apps/backend/package.json apps/backend/package-lock.json ./
RUN npm ci
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
PLAYWRIGHT_DOWNLOAD_HOST="${PLAYWRIGHT_DOWNLOAD_HOST}" npx playwright install --with-deps chromium; \
RUN if [ -n "${PLAYWRIGHT_DOWNLOAD_HOST}" ]; then \
echo "Trying Playwright mirror: ${PLAYWRIGHT_DOWNLOAD_HOST}"; \
PLAYWRIGHT_DOWNLOAD_HOST="${PLAYWRIGHT_DOWNLOAD_HOST}" npx playwright install --with-deps chromium \
|| (echo "Playwright mirror failed, falling back to official host" && npx playwright install --with-deps chromium); \
else \
npx playwright install --with-deps chromium; \
fi