mirror of
https://github.com/snapotter-hq/SnapOtter.git
synced 2026-08-03 07:46:42 +02:00
fix(docker): copy patches/ before pnpm install so cold builds succeed (#300)
The builder and production stages run `pnpm install` without first COPYing the patches/ directory, so package.json's patchedDependencies makes pnpm abort with `ENOENT: ... patches/gray-matter@4.0.3.patch` on any build whose pnpm-store layer cache is cold (e.g. a fresh CI runner or `docker compose build`). The existing image only built because that layer happened to be cached. Copy patches/ ahead of both `pnpm install` invocations. Verified: a clean `docker build` of docker/Dockerfile now completes end to end.
This commit is contained in:
@@ -46,6 +46,10 @@ COPY packages/media-engine/package.json packages/media-engine/tsconfig.json ./pa
|
||||
COPY packages/doc-engine/package.json packages/doc-engine/tsconfig.json ./packages/doc-engine/
|
||||
COPY packages/ai/package.json packages/ai/tsconfig.json ./packages/ai/
|
||||
|
||||
# pnpm patchedDependencies (package.json) needs the patch files present before
|
||||
# install, or `pnpm install` aborts with ENOENT on the patch.
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Install ALL dependencies (dev + prod needed for building)
|
||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store/v3 \
|
||||
pnpm install --frozen-lockfile
|
||||
@@ -307,6 +311,10 @@ COPY packages/media-engine/package.json packages/media-engine/tsconfig.json ./pa
|
||||
COPY packages/doc-engine/package.json packages/doc-engine/tsconfig.json ./packages/doc-engine/
|
||||
COPY packages/ai/package.json packages/ai/tsconfig.json ./packages/ai/
|
||||
|
||||
# pnpm patchedDependencies (package.json) needs the patch files present before
|
||||
# install, or `pnpm install` aborts with ENOENT on the patch.
|
||||
COPY patches/ ./patches/
|
||||
|
||||
# Install production dependencies (tsx is now in prod deps)
|
||||
# Skip the root prepare script (husky is a devDep, not available in prod)
|
||||
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store/v3 \
|
||||
|
||||
Reference in New Issue
Block a user