This commit is contained in:
+4
-8
@@ -3,17 +3,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
|
||||
|
||||
# Configure npm registry mirror (Liara) — pnpm uses the same registry
|
||||
# Configure npm registry mirror (Liara)
|
||||
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
|
||||
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
|
||||
|
||||
@@ -30,8 +26,8 @@ ARG VITE_CONSOLE_URL
|
||||
ARG VITE_WORKSPACE_ID
|
||||
ARG VITE_HELP_URL
|
||||
|
||||
COPY package*.json pnpm-lock.yaml ./
|
||||
RUN pnpm install --frozen-lockfile --loglevel info
|
||||
COPY package*.json package-lock.json* ./
|
||||
RUN npm ci --loglevel info || npm install --loglevel info
|
||||
COPY . ./
|
||||
RUN set -e; \
|
||||
env_args=""; \
|
||||
@@ -44,7 +40,7 @@ RUN set -e; \
|
||||
[ -n "$VITE_CONSOLE_URL" ] && env_args="$env_args VITE_CONSOLE_URL=$VITE_CONSOLE_URL"; \
|
||||
[ -n "$VITE_WORKSPACE_ID" ] && env_args="$env_args VITE_WORKSPACE_ID=$VITE_WORKSPACE_ID"; \
|
||||
[ -n "$VITE_HELP_URL" ] && env_args="$env_args VITE_HELP_URL=$VITE_HELP_URL"; \
|
||||
eval "env$env_args pnpm run build"
|
||||
eval "env$env_args npm run build"
|
||||
|
||||
FROM nginx:stable-alpine AS production-stage
|
||||
|
||||
|
||||
Reference in New Issue
Block a user