Skip to content

A self-hostable bookmark-everything app (links, notes and images) with AI-based automatic tagging and full text search

build(docker): stop pnpm reinstalling mid-build (#3278)

Mohamed Bassemb2e09e1a1b11
diff --git a/.dockerignore b/.dockerignore
index b605943b..fceed6b8 100644
--- a/.dockerignore
+++ b/.dockerignore
@@ -19,6 +19,7 @@ apps/landing
apps/browser-extension
packages/e2e_tests
packages/benchmarks
+tools/compare-models
tools/seed-snapshot
snapshots
diff --git a/docker/Dockerfile b/docker/Dockerfile
index 19d5043f..38f2fd12 100644
--- a/docker/Dockerfile
+++ b/docker/Dockerfile
@@ -52,6 +52,12 @@ ENV NEXT_TELEMETRY_DISABLED=1
ENV PLAYWRIGHT_SKIP_BROWSER_DOWNLOAD=1
RUN pnpm install --frozen-lockfile
+# `pnpm exec`/`pnpm run` first check node_modules against the workspace and
+# install if they differ, which fails mid-way here (EXDEV across image layers).
+# Fail instead: every workspace package that COPY . . brings in must have its
+# package.json copied above, or be listed in .dockerignore.
+ENV pnpm_config_verify_deps_before_run=error
+
COPY . .
# Each app is built in its own stage so that images only build the apps they
@@ -83,18 +89,18 @@ RUN (cd apps/web && pnpm exec next build --experimental-build-mode compile)
################# Workers Builder ##############
FROM base AS workers_builder
-RUN (cd apps/workers && pnpm --config.verify-deps-before-run=false build)
+RUN (cd apps/workers && pnpm build)
RUN CI=true pnpm deploy --node-linker=isolated --legacy --filter @karakeep/workers --prod /prod/workers
################# CLI Builder ##############
FROM base AS cli_builder
-RUN (cd apps/cli && pnpm --config.verify-deps-before-run=false build)
+RUN (cd apps/cli && pnpm build)
################# MCP Builder ##############
FROM base AS mcp_builder
-RUN (cd apps/mcp && pnpm --config.verify-deps-before-run=false build)
+RUN (cd apps/mcp && pnpm build)
################# The All-in-one builder ##############
FROM node:24-slim AS aio_builder