Playwright固定官方镜像

This commit is contained in:
yml
2026-04-08 17:25:55 +08:00
parent ea6440c844
commit c09368d2c2
3 changed files with 3 additions and 12 deletions
+1 -8
View File
@@ -2,7 +2,6 @@ FROM node:22-bookworm
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
ENV DEBIAN_FRONTEND=noninteractive
@@ -27,13 +26,7 @@ RUN python3 -m pip install --no-cache-dir --break-system-packages uv \
COPY apps/backend/package.json apps/backend/package-lock.json ./
RUN npm ci
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
RUN PLAYWRIGHT_DOWNLOAD_HOST= npx playwright install --with-deps chromium
COPY apps/backend/ ./