fix(tools): speedup npm installation in dockerfile (#43809)

* speedup npm dependency installation in Dockerfile

save time while installing npm dependencies with no npm progress bar

* add npm ci change to builder stage too
This commit is contained in:
jhonDoe15
2021-10-12 22:11:23 +03:00
committed by GitHub
parent 96fad4087d
commit 59241b59ef

View File

@ -3,7 +3,7 @@ USER node
WORKDIR /home/node/build WORKDIR /home/node/build
COPY --chown=node:node . . COPY --chown=node:node . .
RUN npm ci RUN npm ci --no-progress
RUN npm run build:curriculum RUN npm run build:curriculum
RUN npm run build:server RUN npm run build:server
@ -13,9 +13,9 @@ WORKDIR /home/node/api
# get and install deps # get and install deps
COPY --from=builder --chown=node:node /home/node/build/package.json /home/node/build/package-lock.json ./ COPY --from=builder --chown=node:node /home/node/build/package.json /home/node/build/package-lock.json ./
COPY --from=builder --chown=node:node /home/node/build/api-server/package.json /home/node/build/api-server/package-lock.json api-server/ COPY --from=builder --chown=node:node /home/node/build/api-server/package.json /home/node/build/api-server/package-lock.json api-server/
RUN npm ci --production --ignore-scripts \ RUN npm ci --production --ignore-scripts --no-progress \
&& cd api-server \ && cd api-server \
&& npm ci --production \ && npm ci --production --no-progress \
&& npm cache clean --force && npm cache clean --force
COPY --from=builder --chown=node:node /home/node/build/api-server/lib/ api-server/lib/ COPY --from=builder --chown=node:node /home/node/build/api-server/lib/ api-server/lib/
COPY --from=builder --chown=node:node /home/node/build/utils/ utils/ COPY --from=builder --chown=node:node /home/node/build/utils/ utils/