Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

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

Bowen Liang55fc46c707f1
diff --git a/api/Dockerfile b/api/Dockerfile
index 678416f1136..96b230e173b 100644
--- a/api/Dockerfile
+++ b/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
diff --git a/web/Dockerfile b/web/Dockerfile
index 18cd3331ed4..5928cc29b0f 100644
--- a/web/Dockerfile
+++ b/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