mirror of
https://github.com/bookorbit/bookorbit.git
synced 2026-11-03 00:11:37 -06:00
build(docker): include dependency patches in image builds
Copy workspace patch files before frozen installs so pnpm can validate patched dependencies. Permit unused client patches only while deploying the server production bundle.
This commit is contained in:
+3
-1
@@ -8,6 +8,7 @@ FROM base AS client-builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/types/package.json ./packages/types/
|
||||
COPY client/package.json ./client/
|
||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
||||
@@ -22,6 +23,7 @@ FROM base AS server-builder
|
||||
WORKDIR /app
|
||||
|
||||
COPY package.json pnpm-workspace.yaml pnpm-lock.yaml ./
|
||||
COPY patches/ ./patches/
|
||||
COPY packages/types/package.json ./packages/types/
|
||||
COPY server/package.json ./server/
|
||||
RUN --mount=type=cache,id=pnpm,target=/root/.local/share/pnpm/store \
|
||||
@@ -32,7 +34,7 @@ COPY server/ ./server/
|
||||
RUN pnpm --filter server run build
|
||||
|
||||
# pnpm deploy prunes to prod deps; dist/ is gitignored so copy it in after.
|
||||
RUN pnpm --filter server deploy --prod --legacy /deploy
|
||||
RUN pnpm --config.allow-unused-patches=true --filter server deploy --prod --legacy /deploy
|
||||
RUN cp -r /app/server/dist /deploy/dist
|
||||
RUN mkdir -p /deploy/migrations && cp -r /app/server/src/db/migrations/. /deploy/migrations/
|
||||
|
||||
|
||||
Reference in New Issue
Block a user