This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
node_modules
|
||||
.nuxt
|
||||
dist
|
||||
.git
|
||||
.github
|
||||
*.log
|
||||
npm-debug.log*
|
||||
.env
|
||||
.env.*
|
||||
.idea
|
||||
.vscode
|
||||
.DS_Store
|
||||
coverage
|
||||
.nyc_output
|
||||
.cache
|
||||
*.md
|
||||
orisoxin.archive
|
||||
*.zip
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
.editorconfig
|
||||
.eslintrc.js
|
||||
@@ -39,6 +39,8 @@ jobs:
|
||||
file: ./Dockerfile
|
||||
push: true
|
||||
tags: ${{ env.IMAGE_URL }}
|
||||
cache-from: type=gha
|
||||
cache-to: type=gha,mode=max
|
||||
|
||||
- name: Install CapRover CLI
|
||||
run: npm install -g caprover
|
||||
|
||||
+29
-26
@@ -1,47 +1,50 @@
|
||||
FROM node:20-alpine AS base
|
||||
|
||||
ENV TZ=Asia/Tehran
|
||||
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
|
||||
WORKDIR /deps
|
||||
COPY package*.json ./
|
||||
RUN npm install
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci
|
||||
|
||||
FROM base AS prod-deps
|
||||
WORKDIR /deps
|
||||
COPY package*.json ./
|
||||
RUN --mount=type=cache,target=/root/.npm \
|
||||
npm ci --omit=dev
|
||||
|
||||
FROM base AS builder
|
||||
WORKDIR /build
|
||||
COPY . ./
|
||||
COPY --from=deps /temp-deps/node_modules ./node_modules
|
||||
COPY . .
|
||||
COPY --from=deps /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
|
||||
ENV NODE_ENV=production
|
||||
ENV PORT=3000
|
||||
ENV HOSTNAME=0.0.0.0
|
||||
|
||||
RUN addgroup -S appgroup && \
|
||||
adduser -S appuser -G appgroup && \
|
||||
chown appuser:appgroup /app
|
||||
|
||||
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 ./
|
||||
|
||||
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/server ./server
|
||||
COPY --from=builder --chown=appuser:appgroup /build/nuxt.config.js ./
|
||||
COPY --from=prod-deps --chown=appuser:appgroup /deps/node_modules ./node_modules
|
||||
COPY --from=prod-deps --chown=appuser:appgroup /deps/package.json ./package.json
|
||||
|
||||
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"]
|
||||
HEALTHCHECK --interval=30s --timeout=5s --start-period=30s --retries=3 \
|
||||
CMD node -e "require('http').get('http://127.0.0.1:3000/',r=>process.exit(r.statusCode<500?0:1)).on('error',()=>process.exit(1))"
|
||||
|
||||
CMD ["node", "node_modules/nuxt/bin/nuxt.js", "start"]
|
||||
|
||||
Generated
+20880
File diff suppressed because it is too large
Load Diff
+2
-2
@@ -33,10 +33,8 @@
|
||||
"mongoose": "^5.12.5",
|
||||
"mongoose-paginate-v2": "^1.3.18",
|
||||
"nodemailer": "^6.6.5",
|
||||
"nodemon": "^3.1.4",
|
||||
"nuxt": "^2.15.3",
|
||||
"read-excel-file": "^5.2.10",
|
||||
"sass": "^1.77.6",
|
||||
"scroll-to-element": "^2.0.3",
|
||||
"sharp": "^0.28.1",
|
||||
"slick-carousel": "^1.8.1",
|
||||
@@ -45,6 +43,8 @@
|
||||
"devDependencies": {
|
||||
"@nuxt/types": "^2.15.8",
|
||||
"@nuxtjs/pwa": "^3.3.5",
|
||||
"nodemon": "^3.1.4",
|
||||
"sass": "^1.77.6",
|
||||
"sass-loader": "^10.1.0"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user