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

update docker 3
This commit is contained in:
2026-05-31 10:20:23 +00:00
parent 6aaf5ac033
commit 6cdf0ea3dd
+7 -11
View File
@@ -1,20 +1,13 @@
FROM node:22-alpine AS builder 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 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 RUN apk add --no-cache tzdata
# Install pnpm directly
RUN npm install -g pnpm@10 RUN npm install -g pnpm@10
# Set timezone
RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone
WORKDIR /build WORKDIR /build
# Optional build args
ARG VITE_TOKEN_NAME ARG VITE_TOKEN_NAME
ARG VITE_REFRESH_TOKEN_NAME ARG VITE_REFRESH_TOKEN_NAME
ARG VITE_DANAK_BASE_URL ARG VITE_DANAK_BASE_URL
@@ -27,9 +20,13 @@ ARG VITE_HELP_URL
COPY package*.json pnpm-lock.yaml ./ COPY package*.json pnpm-lock.yaml ./
# Use official npm registry because Liara mirror returns 502 for some packages RUN sh -c '\
RUN pnpm config set registry https://registry.npmjs.org/ \ pnpm config set registry https://package-mirror.liara.ir/repository/npm/ && \
&& pnpm install --frozen-lockfile --loglevel info 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 . ./ COPY . ./
@@ -48,7 +45,6 @@ RUN set -e; \
FROM nginx:stable-alpine AS production-stage 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 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 COPY --from=builder /build/dist /usr/share/nginx/html