From af9e609daa1872ad1d160032d9a53284733560fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maciej=20Urba=C5=84czyk?= Date: Mon, 17 Jan 2022 21:46:07 +0100 Subject: [PATCH] fix: force 2 version of packageLock in the package-lock.json in Dockerfile (#37) --- Dockerfile | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Dockerfile b/Dockerfile index f12f959c..702bce43 100644 --- a/Dockerfile +++ b/Dockerfile @@ -12,8 +12,11 @@ FROM base AS build WORKDIR /app COPY . . + # install dependencies -RUN npm ci +# 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 @@ -24,12 +27,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