优化下载速度, 配置镜像站-2
This commit is contained in:
@@ -49,7 +49,7 @@ docker compose up -d
|
|||||||
|
|
||||||
- Debian `apt` 使用腾讯云镜像
|
- Debian `apt` 使用腾讯云镜像
|
||||||
- `npm` 使用 `npmmirror`
|
- `npm` 使用 `npmmirror`
|
||||||
- Playwright 浏览器下载在 `amd64` 下默认使用 `npmmirror`,其他架构回退官方源
|
- Playwright 浏览器默认先尝试 `npmmirror`,失败后自动回退官方源
|
||||||
- `uv` / `pip` 使用腾讯云 PyPI 镜像
|
- `uv` / `pip` 使用腾讯云 PyPI 镜像
|
||||||
|
|
||||||
如果你的服务器网络环境不同,也可以在构建时覆盖:
|
如果你的服务器网络环境不同,也可以在构建时覆盖:
|
||||||
|
|||||||
@@ -4,7 +4,6 @@ ARG DEBIAN_MIRROR=mirrors.cloud.tencent.com
|
|||||||
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
ARG NPM_REGISTRY=https://registry.npmmirror.com
|
||||||
ARG PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright
|
ARG PLAYWRIGHT_DOWNLOAD_HOST=https://npmmirror.com/mirrors/playwright
|
||||||
ARG UV_DEFAULT_INDEX=https://mirrors.cloud.tencent.com/pypi/simple
|
ARG UV_DEFAULT_INDEX=https://mirrors.cloud.tencent.com/pypi/simple
|
||||||
ARG TARGETARCH
|
|
||||||
|
|
||||||
ENV DEBIAN_FRONTEND=noninteractive
|
ENV DEBIAN_FRONTEND=noninteractive
|
||||||
ENV PLAYWRIGHT_BROWSERS_PATH=/ms-playwright
|
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 ./
|
COPY apps/backend/package.json apps/backend/package-lock.json ./
|
||||||
RUN npm ci
|
RUN npm ci
|
||||||
|
|
||||||
RUN if [ "${TARGETARCH}" = "amd64" ]; then \
|
RUN if [ -n "${PLAYWRIGHT_DOWNLOAD_HOST}" ]; then \
|
||||||
PLAYWRIGHT_DOWNLOAD_HOST="${PLAYWRIGHT_DOWNLOAD_HOST}" npx playwright install --with-deps chromium; \
|
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 \
|
else \
|
||||||
npx playwright install --with-deps chromium; \
|
npx playwright install --with-deps chromium; \
|
||||||
fi
|
fi
|
||||||
|
|||||||
+1
-1
@@ -78,7 +78,7 @@ docker compose up -d
|
|||||||
|
|
||||||
- Debian `apt`:腾讯云镜像
|
- Debian `apt`:腾讯云镜像
|
||||||
- `npm`:`npmmirror`
|
- `npm`:`npmmirror`
|
||||||
- Playwright:`amd64` 默认走 `npmmirror`,其他架构自动回退官方源
|
- Playwright:默认先走 `npmmirror`,失败后自动回退官方源
|
||||||
- `uv` / `pip`:腾讯云 PyPI 镜像
|
- `uv` / `pip`:腾讯云 PyPI 镜像
|
||||||
|
|
||||||
如果你要切换成别的源,可以手动执行:
|
如果你要切换成别的源,可以手动执行:
|
||||||
|
|||||||
Reference in New Issue
Block a user