update docker 3
This commit is contained in:
+7
-11
@@ -1,20 +1,13 @@
|
||||
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
|
||||
|
||||
# Install tzdata
|
||||
RUN apk add --no-cache tzdata
|
||||
|
||||
# Install pnpm directly
|
||||
RUN npm install -g pnpm@10
|
||||
|
||||
# Set timezone
|
||||
RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
|
||||
|
||||
WORKDIR /build
|
||||
|
||||
# Optional build args
|
||||
ARG VITE_TOKEN_NAME
|
||||
ARG VITE_REFRESH_TOKEN_NAME
|
||||
ARG VITE_DANAK_BASE_URL
|
||||
@@ -27,9 +20,13 @@ ARG VITE_HELP_URL
|
||||
|
||||
COPY package*.json pnpm-lock.yaml ./
|
||||
|
||||
# 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
|
||||
RUN sh -c '\
|
||||
pnpm config set registry https://package-mirror.liara.ir/repository/npm/ && \
|
||||
pnpm install --frozen-lockfile --loglevel info \
|
||||
|| \
|
||||
(echo "Liara mirror failed, falling back to npmjs..." && \
|
||||
pnpm config set registry https://registry.npmjs.org/ && \
|
||||
pnpm install --frozen-lockfile --loglevel info)'
|
||||
|
||||
COPY . ./
|
||||
|
||||
@@ -48,7 +45,6 @@ RUN set -e; \
|
||||
|
||||
FROM nginx:stable-alpine AS production-stage
|
||||
|
||||
# Change Alpine repo
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user