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

This commit is contained in:
mahyargdz
2024-10-10 21:49:00 +03:30
parent 6fe34708a2
commit 8cf0492c87
464 changed files with 79533 additions and 0 deletions
+47
View File
@@ -0,0 +1,47 @@
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 npm install
FROM base AS builder
WORKDIR /build
COPY . ./
COPY --from=deps /temp-deps/node_modules ./node_modules
RUN npm run build
RUN npm install --omit=dev
FROM base AS runner
WORKDIR /app
ENV NUXT_TELEMETRY_DISABLED=1
RUN addgroup -S appgroup && adduser -S appuser -G appgroup
RUN chown -R appuser:appgroup /app
# COPY --from=builder --chown=appuser:appgroup /build/.nuxt ./.nuxt
# COPY --from=builder --chown=appuser:appgroup /build/static ./static
# COPY --from=builder --chown=appuser:appgroup /build/package.json ./
# COPY --from=builder --chown=appuser:appgroup /build/node_modules/ ./node_modules/
COPY --from=builder --chown=appuser:appgroup /build ./
USER appuser
# Set environment variables
ENV NODE_ENV=production
ENV PORT=3000
ENV HOSTNAME="0.0.0.0"
EXPOSE 3000
# Start the Nuxt 2 app
CMD ["npm", "start"]