From 979caa9bdaafe43202f62c546254ac09da0600b0 Mon Sep 17 00:00:00 2001 From: morteza-mortezai Date: Fri, 29 May 2026 17:50:51 +0330 Subject: [PATCH] update docker --- Dockerfile | 49 +++++++------------------------------------------ 1 file changed, 7 insertions(+), 42 deletions(-) diff --git a/Dockerfile b/Dockerfile index 432495f..f0b5f47 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,6 +1,13 @@ # Stage 1: Base FROM node:22-alpine AS base +# Use Alpine mirror +RUN sed -i 's|https://dl-cdn.alpinelinux.org/alpine|https://mirror.de.velop.ir/alpine|g' /etc/apk/repositories + +# Configure npm registry mirror +ENV NPM_CONFIG_REGISTRY=https://package-mirror.liara.ir/repository/npm/ +RUN npm config set registry https://package-mirror.liara.ir/repository/npm/ + # Set timezone (Node.js respects TZ env variable natively) ENV TZ=Asia/Tehran @@ -34,45 +41,3 @@ ENV NODE_ENV=production EXPOSE 4000 CMD ["npm", "start"] - -# # Stage 1: Build Stage -# FROM node:22-alpine AS base - -# RUN npm install -g corepack@latest -# RUN corepack enable && corepack prepare pnpm@9 --activate - -# # Install tzdata to support timezone settings -# RUN apk add --no-cache tzdata - -# # Set the timezone to Asia/Tehran -# RUN cp /usr/share/zoneinfo/Asia/Tehran /etc/localtime && echo "Asia/Tehran" > /etc/timezone - - -# FROM base AS deps -# WORKDIR /temp-deps -# COPY package*.json pnpm-lock.yaml ./ -# RUN pnpm install --frozen-lockfile --loglevel info - - -# FROM base AS builder -# WORKDIR /build -# COPY . ./ -# 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 pnpm install --prod --frozen-lockfile --loglevel info - -# FROM base AS runner -# RUN addgroup -S appgroup && adduser -S appuser -G appgroup -# WORKDIR /app - -# COPY . ./ -# COPY --from=builder --chown=appuser:appgroup /build/ ./ - -# RUN chown -R appuser:appgroup /app - -# USER appuser - -# ENV NODE_ENV=production -# EXPOSE 3000 - -# CMD ["npm", "start"] \ No newline at end of file