dockerfile
This commit is contained in:
28
.dockerignore
Normal file
28
.dockerignore
Normal file
@@ -0,0 +1,28 @@
|
||||
.git
|
||||
.next
|
||||
.sixth
|
||||
.vscode
|
||||
node_modules
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
pnpm-debug.log*
|
||||
|
||||
.env
|
||||
.env.*
|
||||
!.env.example
|
||||
|
||||
Dockerfile
|
||||
.dockerignore
|
||||
|
||||
*.zip
|
||||
tsconfig.tsbuildinfo
|
||||
README*.md
|
||||
CHECKLIST.md
|
||||
FEATURES.md
|
||||
IMPLEMENTATION_SUMMARY.md
|
||||
QUIZ_FEATURE_GUIDE.md
|
||||
QUIZ_QUICKSTART.md
|
||||
SETUP.md
|
||||
SWAGGER-FA.md
|
||||
USER-GUIDE.md
|
||||
44
Dockerfile
Normal file
44
Dockerfile
Normal file
@@ -0,0 +1,44 @@
|
||||
FROM node:24-alpine AS deps
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json package-lock.json ./
|
||||
RUN npm ci
|
||||
|
||||
FROM node:24-alpine AS builder
|
||||
WORKDIR /app
|
||||
|
||||
ARG DATABASE_URL
|
||||
ARG NEXTAUTH_URL
|
||||
ARG NEXTAUTH_SECRET
|
||||
ENV DATABASE_URL=$DATABASE_URL
|
||||
ENV NEXTAUTH_URL=$NEXTAUTH_URL
|
||||
ENV NEXTAUTH_SECRET=$NEXTAUTH_SECRET
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
|
||||
COPY --from=deps /app/node_modules ./node_modules
|
||||
COPY . .
|
||||
|
||||
RUN npx prisma generate
|
||||
RUN npm run build
|
||||
RUN npm prune --omit=dev
|
||||
|
||||
FROM node:24-alpine AS runner
|
||||
WORKDIR /app
|
||||
|
||||
ENV NODE_ENV=production
|
||||
ENV NEXT_TELEMETRY_DISABLED=1
|
||||
ENV PORT=3000
|
||||
|
||||
RUN addgroup -S nextjs && adduser -S nextjs -G nextjs
|
||||
|
||||
COPY --from=builder --chown=nextjs:nextjs /app/package.json ./package.json
|
||||
COPY --from=builder --chown=nextjs:nextjs /app/node_modules ./node_modules
|
||||
COPY --from=builder --chown=nextjs:nextjs /app/.next ./.next
|
||||
COPY --from=builder --chown=nextjs:nextjs /app/public ./public
|
||||
COPY --from=builder --chown=nextjs:nextjs /app/prisma ./prisma
|
||||
|
||||
USER nextjs
|
||||
|
||||
EXPOSE 3000
|
||||
|
||||
CMD ["npm", "run", "start"]
|
||||
Reference in New Issue
Block a user