Use BuildKit's cache mount.

This commit is contained in:
FireMasterK 2022-02-23 12:56:43 +00:00
parent 6b4bd1a034
commit 38cc2d5190
No known key found for this signature in database
GPG key ID: 49451E4482CC5BCD

View file

@ -2,13 +2,12 @@ FROM node:lts-alpine AS build
WORKDIR /app/ WORKDIR /app/
COPY package.json yarn.lock ./
RUN yarn install --prefer-offline
COPY . . COPY . .
RUN yarn build && sed -i 's/fonts.gstatic.com/fonts.kavin.rocks/g' dist/assets/*.css RUN --mount=type=cache,target=/root/.cache/yarn \
--mount=type=cache,target=/app/node_modules \
yarn install --prefer-offline && \
yarn build && sed -i 's/fonts.gstatic.com/fonts.kavin.rocks/g' dist/assets/*.css
FROM nginx:alpine FROM nginx:alpine