update docker 3
This commit is contained in:
+9
-16
@@ -3,25 +3,18 @@ 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
|
||||
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
|
||||
# Install tzdata
|
||||
RUN apk add --no-cache tzdata
|
||||
|
||||
# ---- 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/
|
||||
# ------------------------------------------------------------
|
||||
# Install pnpm directly
|
||||
RUN npm install -g pnpm@10
|
||||
|
||||
# Set the timezone to Asia/Tehran
|
||||
# Set timezone
|
||||
RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Optional build-args
|
||||
# Optional build args
|
||||
ARG VITE_TOKEN_NAME
|
||||
ARG VITE_REFRESH_TOKEN_NAME
|
||||
ARG VITE_DANAK_BASE_URL
|
||||
@@ -33,7 +26,10 @@ ARG VITE_WORKSPACE_ID
|
||||
ARG VITE_HELP_URL
|
||||
|
||||
COPY package*.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --loglevel info
|
||||
|
||||
# Use official npm registry because Liara mirror returns 502 for some packages
|
||||
RUN pnpm config set registry https://registry.npmjs.org/ \
|
||||
&& pnpm install --frozen-lockfile --loglevel info
|
||||
|
||||
COPY . ./
|
||||
|
||||
@@ -56,10 +52,7 @@ FROM nginx:stable-alpine AS production-stage
|
||||
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
|
||||
|
||||
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;"]
|
||||
|
||||
Reference in New Issue
Block a user