Skip to content

Commit

Permalink
fix: force 2 version of packageLock in the package-lock.json in Docke…
Browse files Browse the repository at this point in the history
…rfile (#37)
  • Loading branch information
magicmatatjahu authored Jan 17, 2022
1 parent 03c5c53 commit af9e609
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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"]

0 comments on commit af9e609

Please sign in to comment.