Playwright固定官方镜像
This commit is contained in:
@@ -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/ ./
|
||||
|
||||
|
||||
Reference in New Issue
Block a user