From 33784f1342487007619ddb02ccef3167d5cd8df7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Kr=C3=A1tk=C3=BD?= Date: Thu, 27 Jan 2022 09:30:52 -0800 Subject: [PATCH] Fix `with-docker` example dockerfile (#33695) Fixed `dockerfile` in `with-docker` example ## Bug - error when executing `docker build -t nextjs-docker .` - `yarn.lock` file is missing ## Documentation / Examples - edited to not fail when `package-lock.json` or `yarn.lock` are not found - example: use `with-docker` example - [x] Make sure the linting passes by running yarn lint Co-authored-by: JJ Kasper <22380829+ijjk@users.noreply.github.com> --- examples/with-docker/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/examples/with-docker/Dockerfile b/examples/with-docker/Dockerfile index aa4b329d5e39965..57635340bb16f2a 100644 --- a/examples/with-docker/Dockerfile +++ b/examples/with-docker/Dockerfile @@ -6,6 +6,10 @@ WORKDIR /app COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile +# If using npm with a `package-lock.json` comment out above and use below instead +# COPY package.json package-lock.json / +# RUN npm install + # Rebuild the source code only when needed FROM node:16-alpine AS builder WORKDIR /app