update docker
Build and Deploy Docker Images / build_and_deploy (push) Has been cancelled

This commit is contained in:
2026-06-03 12:04:40 +03:30
parent 11717c9a78
commit a548a4e196
+16 -7
View File
@@ -1,34 +1,42 @@
# Stage 1: Build Stage
# Stage 1: Base
FROM node:22-alpine AS base
RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories
ENV NPM_CONFIG_REGISTRY=https://mirror-npm.runflare.com
ENV COREPACK_NPM_REGISTRY=https://mirror-npm.runflare.com
RUN npm install -g corepack@latest
RUN corepack enable && corepack prepare pnpm@9.15.9 --activate
# Install pnpm directly instead of using corepack
RUN npm install -g pnpm@9.15.9
# Timezone (Node 22 respects TZ without needing tzdata installed)
# Timezone
ENV TZ=Asia/Tehran
# Stage 2: Dependencies
FROM base AS deps
WORKDIR /temp-deps
COPY package*.json pnpm-lock.yaml ./
COPY package.json pnpm-lock.yaml ./
RUN pnpm install --frozen-lockfile --loglevel info
# Stage 3: Build
FROM base AS builder
WORKDIR /build
COPY . ./
COPY . .
COPY --from=deps /temp-deps/node_modules ./node_modules
RUN pnpm run build
RUN pnpm prune --prod
# Stage 4: Runtime
FROM base AS runner
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
COPY --from=builder --chown=appuser:appgroup /build/ ./
@@ -36,6 +44,7 @@ COPY --from=builder --chown=appuser:appgroup /build/ ./
USER appuser
ENV NODE_ENV=production
EXPOSE 3500
CMD ["node", "dist/main"]