Skip to content

Commit 2c641f1

Browse files
fix(docker): stop running dependency install scripts in the image builds (#811)
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
1 parent a4cf9ac commit 2c641f1

3 files changed

Lines changed: 23 additions & 17 deletions

File tree

.dockerignore

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,7 @@ dist/
3232
standalone/webapp/android
3333
standalone/webapp/ios
3434

35-
# Keep the vscode-extension package.json files (pnpm install reads them
36-
# as workspace manifests), but drop the source.
37-
vscode-extension/src
38-
vscode-extension/webview/src
39-
vscode-extension/webview/dist
40-
vscode-extension/dist
35+
vscode-extension/
4136

4237
scripts/
4338
.changeset/

standalone/server/Dockerfile

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,17 @@ COPY library/package.json ./library/
2323
# `pnpm deploy` to walk the library's dependency tree.
2424
COPY packages/ui/package.json ./packages/ui/
2525
COPY standalone/server/package.json ./standalone/server/
26-
COPY standalone/webapp/package.json ./standalone/webapp/
27-
COPY vscode-extension/package.json ./vscode-extension/
28-
COPY vscode-extension/webview/package.json ./vscode-extension/webview/
2926

27+
# `<pkg>...` selects the server plus the workspaces it depends on, so the only
28+
# manifests this stage needs are the ones copied above.
29+
#
30+
# `--ignore-scripts` keeps the stage hermetic. The dependency lifecycle scripts
31+
# reachable from here either download a binary over the network or compile C++
32+
# against a toolchain this slim image deliberately omits; nothing the server is
33+
# built from, or runs on, needs either. `pnpm deploy` below still builds any
34+
# production dependency that genuinely requires it.
3035
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
31-
pnpm install --frozen-lockfile
36+
pnpm install --frozen-lockfile --ignore-scripts --filter @tumaet/server...
3237

3338
COPY library ./library
3439
COPY packages/ui ./packages/ui

standalone/webapp/Dockerfile

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,23 @@ WORKDIR /app
1616

1717
COPY pnpm-lock.yaml pnpm-workspace.yaml package.json .npmrc ./
1818
COPY library/package.json ./library/
19-
# The library now depends on the @tumaet/ui workspace package; without it the
20-
# pnpm install can't link it and `pnpm --filter @tumaet/ui run build:*` no-ops,
21-
# so the library's tsc -b fails to resolve @tumaet/ui/components/*.
19+
# The library depends on the @tumaet/ui workspace package; without its manifest
20+
# pnpm can't link it and `pnpm --filter @tumaet/ui run build:*` no-ops, so the
21+
# library's tsc -b fails to resolve @tumaet/ui/components/*.
2222
COPY packages/ui/package.json ./packages/ui/
2323
COPY standalone/webapp/package.json ./standalone/webapp/
24-
COPY standalone/server/package.json ./standalone/server/
25-
COPY vscode-extension/package.json ./vscode-extension/
26-
COPY vscode-extension/webview/package.json ./vscode-extension/webview/
2724

25+
# `<pkg>...` selects the webapp plus the workspaces it depends on, so the only
26+
# manifests this stage needs are the ones copied above.
27+
#
28+
# `--ignore-scripts` keeps the stage hermetic. Every dependency lifecycle script
29+
# reachable from here either downloads a binary over the network (sharp, pulled
30+
# in by @capacitor/assets for mobile icon generation) or compiles C++ against a
31+
# toolchain this slim image deliberately omits (cpu-features). Nothing the
32+
# webapp bundle is built from needs either, and a script that reaches the
33+
# network turns an image build into a coin flip on GitHub Releases being up.
2834
RUN --mount=type=cache,id=pnpm,target=/pnpm/store \
29-
pnpm install --frozen-lockfile
35+
pnpm install --frozen-lockfile --ignore-scripts --filter @tumaet/webapp...
3036

3137
COPY library ./library
3238
COPY packages/ui ./packages/ui

0 commit comments

Comments
 (0)