improvement: speed up dependency installation in docker image rebuilds by mounting cache layer (#3218)

This commit is contained in:
Bowen Liang 2024-04-10 22:49:04 +08:00 committed by GitHub
parent 5102430a68
commit 55fc46c707
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,8 @@ RUN apt-get update \
COPY requirements.txt /requirements.txt COPY requirements.txt /requirements.txt
RUN pip install --prefix=/pkg -r requirements.txt RUN --mount=type=cache,target=/root/.cache/pip \
pip install --prefix=/pkg -r requirements.txt
# production stage # production stage
FROM base AS production FROM base AS production

View File

@ -13,7 +13,8 @@ WORKDIR /app/web
COPY package.json . COPY package.json .
COPY yarn.lock . COPY yarn.lock .
RUN yarn install --frozen-lockfile RUN --mount=type=cache,target=/root/.yarn YARN_CACHE_FOLDER=/root/.yarn \
yarn install --frozen-lockfile
# build resources # build resources