Skip to content

Commit cff18ae

Browse files
strukalexclaude
andcommitted
temporal: fix Docker build mupdf type resolution
The parent tsconfig's `paths.mupdf` points at `../../node_modules/...`, correct for the monorepo layout but it walks above WORKDIR inside the container, where `node_modules` sits next to the tsconfig. Override `paths` in the build-time tsconfig generated by the Dockerfile so it resolves to the in-container `./node_modules/...` location. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 3a4ec90 commit cff18ae

1 file changed

Lines changed: 19 additions & 2 deletions

File tree

apps/temporal/Dockerfile

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,26 @@ ENV DATABASE_URL=${DATABASE_URL}
4141
RUN npx prisma generate --schema=./shared/prisma/schema.prisma
4242

4343
# Copy source and build. Use a build tsconfig that only includes src (exclude prisma.config).
44+
# The parent tsconfig's `paths.mupdf` is `../../node_modules/...` (correct for the monorepo
45+
# layout); in this container `node_modules` sits next to the tsconfig, so we re-declare
46+
# `paths` here to point at the in-container location. `paths` in an extending config
47+
# replaces — not merges with — the parent's, so `@generated/*` must be repeated.
4448
COPY apps/temporal/src ./src
45-
RUN echo '{"extends":"./tsconfig.json","compilerOptions":{"rootDir":"./src"},"include":["src/**/*.ts"]}' > tsconfig.build.json && \
46-
npx tsc -p tsconfig.build.json
49+
RUN cat > tsconfig.build.json <<'EOF'
50+
{
51+
"extends": "./tsconfig.json",
52+
"compilerOptions": {
53+
"rootDir": "./src",
54+
"baseUrl": ".",
55+
"paths": {
56+
"@generated/*": ["src/generated/*"],
57+
"mupdf": ["./node_modules/mupdf/dist/mupdf"]
58+
}
59+
},
60+
"include": ["src/**/*.ts"]
61+
}
62+
EOF
63+
RUN npx tsc -p tsconfig.build.json
4764

4865
# Production stage
4966
FROM node:24-bookworm-slim AS production

0 commit comments

Comments
 (0)