This commit is contained in:
+4
-7
@@ -8,9 +8,6 @@ RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/a
|
|||||||
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
|
ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/
|
||||||
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
|
RUN npm config set registry https://package-mirror.liara.ir/repository/npm/
|
||||||
|
|
||||||
RUN npm install -g pnpm@9
|
|
||||||
|
|
||||||
|
|
||||||
# Install tzdata to support timezone settings
|
# Install tzdata to support timezone settings
|
||||||
RUN apk add --no-cache tzdata
|
RUN apk add --no-cache tzdata
|
||||||
|
|
||||||
@@ -20,16 +17,16 @@ RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /e
|
|||||||
|
|
||||||
FROM base AS deps
|
FROM base AS deps
|
||||||
WORKDIR /temp-deps
|
WORKDIR /temp-deps
|
||||||
COPY package*.json pnpm-lock.yaml ./
|
COPY package*.json package-lock.json ./
|
||||||
RUN pnpm install --frozen-lockfile --loglevel info
|
RUN npm ci --loglevel info
|
||||||
|
|
||||||
|
|
||||||
FROM base AS builder
|
FROM base AS builder
|
||||||
WORKDIR /build
|
WORKDIR /build
|
||||||
COPY . ./
|
COPY . ./
|
||||||
COPY --from=deps /temp-deps/node_modules ./node_modules
|
COPY --from=deps /temp-deps/node_modules ./node_modules
|
||||||
RUN if [ -f package.json ] && grep -q '"build":' package.json; then pnpm run build; fi
|
RUN if [ -f package.json ] && grep -q '"build":' package.json; then npm run build; fi
|
||||||
RUN pnpm install --prod --frozen-lockfile --loglevel info
|
RUN npm prune --omit=dev
|
||||||
|
|
||||||
FROM base AS runner
|
FROM base AS runner
|
||||||
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
|
||||||
|
|||||||
Reference in New Issue
Block a user