update:add ci cd files ==> do not edit those file

This commit is contained in:
mahyargdz
2024-10-10 16:58:55 +03:30
parent dc6c7c63ea
commit ed5e2023f4
179 changed files with 15757 additions and 2277 deletions
+37
View File
@@ -0,0 +1,37 @@
FROM node:20-alpine AS base
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 ./
RUN yarn install
FROM base AS builder
WORKDIR /build
COPY . ./
COPY --from=deps /temp-deps/node_modules ./node_modules
# Check if a build script exists and run the build if it does
RUN if [ -f package.json ] && grep -q '"build":' package.json; then yarn build; fi
RUN yarn install --production --frozen-lockfile
FROM base AS runner
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
WORKDIR /app
COPY --from=builder /build ./
RUN chown -R appuser:appgroup /app
USER appuser
ENV NODE_ENV=production
EXPOSE 3000
CMD ["npm", "start"]