Optimize docker image build

This commit is contained in:
2022-03-14 20:18:30 +03:00
parent 6d50c45fa4
commit c7bad506e1
4 changed files with 418 additions and 424 deletions

View File

@@ -6,7 +6,7 @@ COPY ./package.json ./
COPY ./tsconfig.json ./
COPY ./src ./src
RUN npm i && npm run build
RUN yarn install --production && yarn build
FROM node:lts-alpine as runtime-image
@@ -16,8 +16,6 @@ WORKDIR /root/app
COPY ./package.json ./
COPY ./scripts/healthcheck.js ./
RUN npm i --only=production
COPY --from=build-image /root/app/build ./build
CMD npm run run
CMD yarn run run