From 6cf74ff488b91e5be2300be81aef8683bbc85314 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 17 Jan 2022 17:53:21 +0100 Subject: [PATCH 1/2] fix: force 2 version of packageLock in the package-lock.json --- Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f12f959c..4caa10af 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,10 @@ FROM base AS build WORKDIR /app COPY . . + # install dependencies -RUN npm ci +# switch to the `npm ci` when https://github.com/asyncapi/.github/issues/123 issue will be resolved +RUN npm install # build to a production Javascript RUN npm run build:prod @@ -24,12 +26,11 @@ FROM base AS release WORKDIR /app COPY --from=build /app/dist ./dist # A wildcard is used to ensure both package.json AND package-lock.json are copied -# where available (npm@5+) -COPY package* ./ +COPY --from=build /app/package* ./ # install only production dependencies (defined in "dependencies") RUN npm ci --only=production # copy OpenaAPI document COPY openapi.yaml ./ EXPOSE 80 -CMD ["npm", "run", "start:prod"] +CMD ["npm", "run", "start:prod"] \ No newline at end of file From 290e68a598c5e92b4829df95519f23458ca92c22 Mon Sep 17 00:00:00 2001 From: Matatjahu Date: Mon, 17 Jan 2022 18:46:07 +0100 Subject: [PATCH 2/2] change dockerfile --- Dockerfile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 4caa10af..702bce43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -14,8 +14,9 @@ WORKDIR /app COPY . . # install dependencies -# switch to the `npm ci` when https://github.com/asyncapi/.github/issues/123 issue will be resolved -RUN npm install +# remove package-lock.json with lockVersion: 1 due to problem described in the https://github.com/asyncapi/.github/issues/123 +# remove first run and switch to the `npm ci` when mentioned issue will be resolved +RUN rm package-lock.json; npm install # build to a production Javascript RUN npm run build:prod