fix use mirror

This commit is contained in:
mahmood
2026-09-10 00:25:43 +03:30
parent 05a9837695
commit 56caedb8b2
5 changed files with 34 additions and 12 deletions
+8 -4
View File
@@ -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/ .