Update docker config for production deployment

This commit is contained in:
Mohan Ki
2026-07-27 13:53:10 +05:30
parent 40667e54ac
commit b9454df5c9
4 changed files with 37 additions and 9 deletions
+24
View File
@@ -0,0 +1,24 @@
FROM node:18-alpine AS builder
WORKDIR /app
COPY package*.json ./
RUN npm ci
COPY . .
RUN npm run build
FROM node:18-alpine AS runner
WORKDIR /app
ENV NODE_ENV production
ENV NEXT_TELEMETRY_DISABLED 1
COPY --from=builder /app/public ./public
# Automatically leverage output traces to reduce image size
# https://nextjs.org/docs/advanced-features/output-file-tracing
COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static
EXPOSE 4000
ENV PORT 4000
CMD ["node", "server.js"]