-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
13 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] |