fix use mirror
This commit is contained in:
@@ -11,3 +11,7 @@ DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGR
|
||||
|
||||
# API Configuration
|
||||
PORT=3000
|
||||
|
||||
# npm/pnpm registry used during Docker build (server often cannot reach registry.npmjs.org)
|
||||
# Alternatives: https://package-mirror.liara.ir/repository/npm/ | https://registry.npmmirror.com
|
||||
NPM_REGISTRY=https://mirror.kargadan.ir/repository/npm-group/
|
||||
|
||||
@@ -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 admin-panel --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/ .
|
||||
|
||||
+8
-4
@@ -1,13 +1,17 @@
|
||||
FROM node:20-bookworm AS base
|
||||
|
||||
# Setup pnpm — base image already includes openssl/ca-certificates (no apt needed)
|
||||
# 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 api --docker
|
||||
|
||||
@@ -18,7 +22,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 and its dependencies
|
||||
COPY --from=builder /app/out/full/ .
|
||||
|
||||
@@ -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/ .
|
||||
|
||||
@@ -18,6 +18,8 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/api/Dockerfile
|
||||
args:
|
||||
NPM_REGISTRY: ${NPM_REGISTRY:-https://mirror.kargadan.ir/repository/npm-group/}
|
||||
container_name: goldbank_api
|
||||
depends_on:
|
||||
- db
|
||||
@@ -32,6 +34,8 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/admin-panel/Dockerfile
|
||||
args:
|
||||
NPM_REGISTRY: ${NPM_REGISTRY:-https://mirror.kargadan.ir/repository/npm-group/}
|
||||
container_name: goldbank_admin_panel
|
||||
ports:
|
||||
- "8080:80"
|
||||
@@ -43,6 +47,8 @@ services:
|
||||
build:
|
||||
context: .
|
||||
dockerfile: apps/user-app/Dockerfile
|
||||
args:
|
||||
NPM_REGISTRY: ${NPM_REGISTRY:-https://mirror.kargadan.ir/repository/npm-group/}
|
||||
container_name: goldbank_user_app
|
||||
ports:
|
||||
- "8081:80"
|
||||
|
||||
Reference in New Issue
Block a user