From 1fcf6d3beced16e3e5c9f837d2692b23ec1f8a28 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Kr=C3=A1tk=C3=BD?= Date: Wed, 26 Jan 2022 06:33:42 -0800 Subject: [PATCH 1/4] Fix `with-docker` example dockerfile --- examples/with-docker/Dockerfile | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/examples/with-docker/Dockerfile b/examples/with-docker/Dockerfile index aa4b329d5e39965..2cd171ca3e2fd83 100644 --- a/examples/with-docker/Dockerfile +++ b/examples/with-docker/Dockerfile @@ -3,7 +3,8 @@ FROM node:16-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 ./ +# replace with "COPY package.json yarn.lock ./" if you have yarn.lock file +COPY package.json ./ RUN yarn install --frozen-lockfile # Rebuild the source code only when needed From ffe5d132d17ee6697a218c0d546a81358e1124cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Kr=C3=A1tk=C3=BD?= Date: Wed, 26 Jan 2022 07:16:34 -0800 Subject: [PATCH 2/4] don't fail when file is doesn't exist --- examples/with-docker/Dockerfile | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/examples/with-docker/Dockerfile b/examples/with-docker/Dockerfile index 2cd171ca3e2fd83..c399f03722e2117 100644 --- a/examples/with-docker/Dockerfile +++ b/examples/with-docker/Dockerfile @@ -3,8 +3,7 @@ FROM node:16-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 -# replace with "COPY package.json yarn.lock ./" if you have yarn.lock file -COPY package.json ./ +COPY package.json yarn.lock* package-lock.json* ./ RUN yarn install --frozen-lockfile # Rebuild the source code only when needed From 803fdcf2e1ce98e57ab6bf637ca47cd2f8976dcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Kry=C5=A1tof=20Kr=C3=A1tk=C3=BD?= Date: Wed, 26 Jan 2022 08:15:14 -0800 Subject: [PATCH 3/4] Update examples/with-docker/Dockerfile Co-authored-by: JJ Kasper --- examples/with-docker/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/examples/with-docker/Dockerfile b/examples/with-docker/Dockerfile index c399f03722e2117..5dbd8df8c37168f 100644 --- a/examples/with-docker/Dockerfile +++ b/examples/with-docker/Dockerfile @@ -3,9 +3,13 @@ FROM node:16-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* package-lock.json* ./ +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 From 9b6c693d63d2c331794a5f5e7eeac86f8763d4ce Mon Sep 17 00:00:00 2001 From: JJ Kasper Date: Thu, 27 Jan 2022 10:23:22 -0600 Subject: [PATCH 4/4] Apply suggestions from code review --- examples/with-docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/with-docker/Dockerfile b/examples/with-docker/Dockerfile index 5dbd8df8c37168f..57635340bb16f2a 100644 --- a/examples/with-docker/Dockerfile +++ b/examples/with-docker/Dockerfile @@ -3,7 +3,7 @@ FROM node:16-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 / +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