Skip to content

Commit 3579180

Browse files
waleedlatif1claude
andcommitted
fix(docker): use full bun.lock and copy it into builder
The staging build for app.Dockerfile (commit dc20229, PR #4322) is failing in two ways after switching to turbo prune: 1. turbo 2.9.6's pruned bun.lock is malformed for bun 1.3.x: error: Failed to resolve prod dependency 'wrap-ansi' for package 'log-update' at bun.lock:2688:5 Bun ignores it and falls back to a fresh resolve (~7m install). 2. Next.js 16.1.6's Turbopack production build can't infer the workspace root because /app/bun.lock doesn't exist in the builder stage: Error: We couldn't find the Next.js package (next/package.json) from the project directory: /app/apps/sim This blocks the build entirely. Fix: - deps stage: use the full bun.lock from /app/bun.lock (the original lockfile after `COPY . .` in pruner) instead of the broken /app/out/bun.lock that turbo prune emits. - builder stage: also copy the full bun.lock to /app/bun.lock so Turbopack and turborepo can detect the workspace root. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent 6a7d5ae commit 3579180

1 file changed

Lines changed: 13 additions & 3 deletions

File tree

docker/app.Dockerfile

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,14 @@ RUN turbo prune sim --docker
2929
FROM base AS deps
3030
WORKDIR /app
3131

32-
# Pruned manifests + lockfile from the pruner stage. This layer only invalidates
33-
# when package.json/bun.lock content changes — not on source edits.
32+
# Pruned manifests from the pruner stage. This layer only invalidates when
33+
# package.json/bun.lock content changes — not on source edits.
3434
COPY --from=pruner /app/out/json/ ./
35-
COPY --from=pruner /app/out/bun.lock ./bun.lock
35+
# Use the full bun.lock (not the pruned out/bun.lock). turbo prune emits a
36+
# bun.lock that bun 1.3.x rejects with "Failed to resolve prod dependency",
37+
# forcing a slow fresh resolve. The full lockfile parses cleanly and bun
38+
# only installs what the pruned package.jsons reference.
39+
COPY --from=pruner /app/bun.lock ./bun.lock
3640

3741
# Install all dependencies (including devDependencies — tailwindcss/postcss are
3842
# devDeps but required at build time). Then rebuild isolated-vm against Node.js.
@@ -55,6 +59,12 @@ COPY --from=deps /app/node_modules ./node_modules
5559
# Copy pruned source tree (apps/sim + workspace packages it depends on)
5660
COPY --from=pruner /app/out/full/ ./
5761

62+
# Next.js 16 / Turbopack workspace-root detection looks for a lockfile next to
63+
# the workspace package.json. Without it, `next build` fails with
64+
# "couldn't find next/package.json from /app/apps/sim". turbo also warns
65+
# "Lockfile not found at /app/bun.lock" without it.
66+
COPY --from=pruner /app/bun.lock ./bun.lock
67+
5868
ENV NEXT_TELEMETRY_DISABLED=1 \
5969
VERCEL_TELEMETRY_DISABLED=1 \
6070
DOCKER_BUILD=1

0 commit comments

Comments
 (0)