瀏覽代碼

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

tags/0.6.2
Bowen Liang 1 年之前
父節點
當前提交
55fc46c707
No account linked to committer's email address
共有 2 個文件被更改,包括 4 次插入2 次删除
  1. 2
    1
      api/Dockerfile
  2. 2
    1
      web/Dockerfile

+ 2
- 1
api/Dockerfile 查看文件

@@ -11,7 +11,8 @@ RUN apt-get update \

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
FROM base AS production

+ 2
- 1
web/Dockerfile 查看文件

@@ -13,7 +13,8 @@ WORKDIR /app/web
COPY package.json .
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

Loading…
取消
儲存