fix use mirror
This commit is contained in:
@@ -1,13 +1,17 @@
|
||||
FROM node:20-bookworm AS base
|
||||
|
||||
# Setup pnpm — no apt/apk (build host often cannot reach package mirrors)
|
||||
# Server often cannot reach registry.npmjs.org (Cloudflare). Override in Dokploy if needed.
|
||||
ARG NPM_REGISTRY=https://mirror.kargadan.ir/repository/npm-group/
|
||||
ENV npm_config_registry=${NPM_REGISTRY}
|
||||
ENV PNPM_HOME="/pnpm"
|
||||
ENV PATH="$PNPM_HOME:$PATH"
|
||||
RUN corepack enable pnpm
|
||||
|
||||
# Skip corepack (it fetches pnpm from npmjs/Cloudflare). Install from mirror instead.
|
||||
RUN npm install -g pnpm@9.0.0 turbo@2.10.12 \
|
||||
&& printf 'registry=%s\n' "${NPM_REGISTRY}" > /root/.npmrc
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /app
|
||||
RUN pnpm i -g turbo
|
||||
COPY . .
|
||||
RUN turbo prune user-app --docker
|
||||
|
||||
@@ -17,7 +21,7 @@ WORKDIR /app
|
||||
COPY .gitignore .gitignore
|
||||
COPY --from=builder /app/out/json/ .
|
||||
COPY --from=builder /app/out/pnpm-lock.yaml ./pnpm-lock.yaml
|
||||
RUN pnpm install
|
||||
RUN pnpm install --frozen-lockfile
|
||||
|
||||
# Build the project
|
||||
COPY --from=builder /app/out/full/ .
|
||||
|
||||
Reference in New Issue
Block a user