Skip to content

Commit

Permalink
docker pour build et prod
Browse files Browse the repository at this point in the history
  • Loading branch information
sgalvagno committed Jul 30, 2024
1 parent dfaf354 commit a32919e
Showing 1 changed file with 13 additions and 7 deletions.
20 changes: 13 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
FROM node:14-alpine

# Build stage
FROM node:14-alpine AS builder
WORKDIR /app

COPY package*.json ./
COPY .next ./.next
COPY public ./public
COPY . .
RUN npm ci
RUN npm run build
RUN npx prisma generate

# Production stage
FROM node:14-alpine
WORKDIR /app
COPY --from=builder /app/package*.json ./
COPY --from=builder /app/.next ./.next
COPY --from=builder /app/public ./public
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma
RUN npm ci --only=production

EXPOSE 3000

CMD ["npm", "start"]

0 comments on commit a32919e

Please sign in to comment.