Skip to content

There can be more than Notion and Miro. AFFiNE(pronounced [ə‘fain]) is a next-gen knowledge base that brings planning, sorting and creating all together. Privacy first, open-source, customizable and ready to use.

ci: :rocket: Optimize the docker file to use the build cache

Manjusaka11f1b22d6f63
diff --git a/.github/deployment/Dockerfile-affine b/.github/deployment/Dockerfile-affine
index 6ea3d70fa7..e0bb7e9edf 100644
--- a/.github/deployment/Dockerfile-affine
+++ b/.github/deployment/Dockerfile-affine
@@ -3,7 +3,7 @@ WORKDIR /app
RUN apk add git && npm i -g pnpm@7
COPY . .
# RUN apk add g++ make python3 git libpng-dev
-RUN pnpm i --frozen-lockfile --store=node_modules/.pnpm-store --filter "!ligo-virgo-e2e" --filter "!keck" --filter "!venus" && pnpm run build:local --skip-nx-cache
+RUN --mount=type=cache,target=/app/node_modules,rw,sharing=private pnpm i --frozen-lockfile --store=node_modules/.pnpm-store --filter "!ligo-virgo-e2e" --filter "!keck" --filter "!venus" && pnpm run build:local --skip-nx-cache
FROM node:16-alpine as relocate
WORKDIR /app
diff --git a/.github/deployment/Dockerfile-affine-keck b/.github/deployment/Dockerfile-affine-keck
index 296428f770..75d02dcac8 100644
--- a/.github/deployment/Dockerfile-affine-keck
+++ b/.github/deployment/Dockerfile-affine-keck
@@ -3,7 +3,7 @@ WORKDIR /app
RUN apk add git && npm i -g pnpm@7
COPY . .
# RUN apk add g++ make python3 git libpng-dev
-RUN pnpm i --frozen-lockfile --store=node_modules/.pnpm-store --filter "!ligo-virgo-e2e" --filter "!keck" --filter "!venus" && pnpm run build:local-keck --skip-nx-cache
+RUN --mount=type=cache,target=/app/node_modules,rw,sharing=private pnpm i --frozen-lockfile --store=node_modules/.pnpm-store --filter "!ligo-virgo-e2e" --filter "!keck" --filter "!venus" && pnpm run build:local-keck --skip-nx-cache
FROM node:16-alpine as relocate
WORKDIR /app
diff --git a/.github/deployment/Dockerfile-keck b/.github/deployment/Dockerfile-keck
index 99a31c01c7..7b611c27b2 100644
--- a/.github/deployment/Dockerfile-keck
+++ b/.github/deployment/Dockerfile-keck
@@ -2,7 +2,7 @@ FROM node:16-alpine as builder
WORKDIR /app
RUN apk add g++ make python3 git libpng-dev && npm i -g pnpm@7
COPY . .
-RUN pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && pnpm run build:keck
+RUN --mount=type=cache,target=/app/node_modules,rw,sharing=private pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && pnpm run build:keck
FROM node:16-alpine as node_modules
WORKDIR /app
diff --git a/.github/deployment/Dockerfile-lisa b/.github/deployment/Dockerfile-lisa
index 5721ad090b..4f80f6ebab 100644
--- a/.github/deployment/Dockerfile-lisa
+++ b/.github/deployment/Dockerfile-lisa
@@ -3,7 +3,7 @@ WORKDIR /app
RUN apk add git && npm i -g pnpm@7
COPY . .
# RUN apk add g++ make python3 git libpng-dev
-RUN pnpm i --frozen-lockfile --store=node_modules/.pnpm-store --filter "!ligo-virgo-e2e" --filter "!keck" --filter "!venus" && pnpm run build
+RUN --mount=type=cache,target=/app/node_modules,rw,sharing=private pnpm i --frozen-lockfile --store=node_modules/.pnpm-store --filter "!ligo-virgo-e2e" --filter "!keck" --filter "!venus" && pnpm run build
FROM node:16-alpine as relocate
WORKDIR /app
diff --git a/.github/deployment/Dockerfile-venus b/.github/deployment/Dockerfile-venus
index 27bc80a4be..92a2bb8305 100644
--- a/.github/deployment/Dockerfile-venus
+++ b/.github/deployment/Dockerfile-venus
@@ -2,7 +2,7 @@ FROM node:16-alpine as builder
WORKDIR /app
RUN apk add g++ make python3 git libpng-dev && npm i -g pnpm@7
COPY . .
-RUN pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && pnpm run build:venus
+RUN --mount=type=cache,target=/app/node_modules,rw,sharing=private pnpm i --frozen-lockfile --store=node_modules/.pnpm-store && pnpm run build:venus
FROM node:16-alpine as relocate
WORKDIR /app