Skip to content

Commit

Permalink
Update Dockerfile (vercel#32299)
Browse files Browse the repository at this point in the history
Update `Dockerfile` to match [Next.js docs](https://nextjs.org/docs/deployment#docker-image).
  • Loading branch information
abzr1 committed Dec 12, 2021
1 parent 4f1d95b commit e63322f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions examples/with-docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
# Install dependencies only when needed
FROM node:14-alpine AS deps
FROM node:alpine AS deps
# Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
RUN apk add --no-cache libc6-compat
WORKDIR /app
COPY package.json yarn.lock ./
RUN yarn install --frozen-lockfile

# Rebuild the source code only when needed
FROM node:14-alpine AS builder
FROM node:alpine AS builder
WORKDIR /app
COPY . .
COPY --from=deps /app/node_modules ./node_modules
RUN yarn build
RUN yarn build && yarn install --production --ignore-scripts --prefer-offline

# Production image, copy all the files and run next
FROM node:14-alpine AS runner
FROM node:alpine AS runner
WORKDIR /app

ENV NODE_ENV production
Expand Down

0 comments on commit e63322f

Please sign in to comment.