From d1e69ad59b28f17b0e6c8331eb334cd0ee682510 Mon Sep 17 00:00:00 2001 From: Huarch Date: Mon, 17 Aug 2026 19:25:38 +0800 Subject: [PATCH] build: use mainland package mirrors --- Dockerfile | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index df6c6b0..04238e5 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,17 +1,23 @@ FROM node:24-alpine@sha256:d32cdf619f63fe0471182d08996dd516c6275bb5fd31ae06e55a570bd9e1ad43 AS build +ARG NPM_REGISTRY=https://registry.npmmirror.com +ENV COREPACK_NPM_REGISTRY=${NPM_REGISTRY} +ENV npm_config_registry=${NPM_REGISTRY} + WORKDIR /app RUN corepack enable COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ -RUN pnpm install --frozen-lockfile +RUN pnpm install --frozen-lockfile --registry="${NPM_REGISTRY}" COPY . . RUN pnpm build FROM caddy:2.10.2-alpine@sha256:4c6e91c6ed0e2fa03efd5b44747b625fec79bc9cd06ac5235a779726618e530d -RUN apk add --no-cache jq nodejs +ARG ALPINE_MIRROR=mirrors.aliyun.com +RUN sed -i "s|dl-cdn.alpinelinux.org|${ALPINE_MIRROR}|g" /etc/apk/repositories && \ + apk add --no-cache jq nodejs COPY Caddyfile /etc/caddy/Caddyfile COPY docker-entrypoint.sh /usr/local/bin/tjwater-frontend-entrypoint COPY --from=build /app/dist /srv