Update Dockerfile
deploy to danak / build_and_deploy (push) Has been cancelled

update docker 2
This commit is contained in:
2026-05-31 09:58:20 +00:00
parent b6e72cb18e
commit bff47524c3
+9 -57
View File
@@ -1,75 +1,27 @@
------------------------- Sun May 31 2026 10:05:20 GMT+0000 (Coordinated Universal Time)
Build started for dmail-admin
Ignore warnings for unconsumed build-args if there is any
Step 1/30 : FROM node:22-alpine AS builder
---> 968df39aedce
Step 2/30 : RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
---> Using cache
---> 5e5c0b4f85b3
Step 3/30 : ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
---> Using cache
---> d56f4d537be7
Step 4/30 : RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
---> Using cache
---> 8ca32bc4872d
Step 5/30 : RUN apk add --no-cache tzdata
---> Using cache
---> 0bab33fd23a5
Step 6/30 : RUN npm install -g corepack@latest
---> Using cache
---> 92b395b1a69f
Step 7/30 : RUN corepack enable && corepack prepare pnpm@10 --activate
---> Running in 9905898d729a
Internal Error: Error when performing the request to https://registry.npmjs.org/pnpm; for troubleshooting help, see https://github.com/nodejs/corepack#troubleshooting
at fetch (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:12951:11)
at processTicksAndRejections (node:internal/process/task_queues:103:5)
at runNextTicks (node:internal/process/task_queues:68:3)
at process.processImmediate (node:internal/timers:452:9)
at async fetchAsJson (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:12965:20)
at async fetchAvailableVersions (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:12910:20)
at async fetchAvailableVersions2 (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:13071:14)
at async /usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:13894:25
at async Promise.all (index 0)
at async Engine.resolveDescriptor (/usr/local/lib/node_modules/corepack/dist/lib/corepack.cjs:13891:22)
{"code":1,"message":"The command '/bin/sh -c corepack enable && corepack prepare pnpm@10 --activate' returned a non-zero code: 1"}
The command '/bin/sh -c corepack enable && corepack prepare pnpm@10 --activate' returned a non-zero code: 1
Build has failed!
----------------------
Deploy failed!
Error: {"code":1,"message":"The command '/bin/sh -c corepack enable && corepack prepare pnpm@10 --activate' returned a non-zero code: 1"}
The command '/bin/sh -c corepack enable && corepack prepare pnpm@10 --activate' returned a non-zero code: 1
----------------------------
FROM node:22-alpine AS builder
# Change Alpine repo
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
# Configure npm registry mirror (Liara) — pnpm uses the same registry
# Configure npm registry mirror
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
# Install tzdata to support timezone settings
RUN apk add --no-cache tzdata
RUN npm install -g corepack@latest
RUN corepack enable && corepack prepare pnpm@10 --activate
# ---- FIX: avoid corepack fetching from registry.npmjs.org ----
# Install pnpm from your npm mirror instead of "corepack prepare"
RUN npm i -g pnpm@10
RUN pnpm config set registry https://package-mirror.liara.ir/repository/npm/
# ------------------------------------------------------------
# Set the timezone to Asia/Tehran
RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
WORKDIR /build
# Optional build-args (CapRover / docker build --build-arg). When unset, Vite reads .env from COPY.
# Optional build-args
ARG VITE_TOKEN_NAME
ARG VITE_REFRESH_TOKEN_NAME
ARG VITE_DANAK_BASE_URL
@@ -82,7 +34,9 @@ ARG VITE_HELP_URL
COPY package*.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --loglevel info
COPY . ./
RUN set -e; \
env_args=""; \
[ -n "$VITE_TOKEN_NAME" ] && env_args="$env_args VITE_TOKEN_NAME=$VITE_TOKEN_NAME"; \
@@ -103,11 +57,9 @@ RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/a
COPY --from=builder /build/dist /usr/share/nginx/html
# (keep your filename as-is; I assume you intentionally wrote nginx.con[f])
COPY --from=builder /build/nginx.con[f] /etc/nginx/conf.d/default.conf
RUN cat /etc/nginx/conf.d/default.conf
EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]
------------------update this docker such that fix this error