perf(docker): use turbo prune for app.Dockerfile#4322
Conversation
Replaces manual workspace package.json copies with `turbo prune sim --docker`, matching the canonical Vercel/Turborepo monorepo pattern (and the existing realtime.Dockerfile). - New `pruner` stage emits `out/json` (manifests + lockfile) and `out/full` (sources) for only the packages sim actually depends on. - `deps` stage installs from the pruned manifest, so cache invalidates only when package.json/bun.lock change — not on source edits. - Drops 24 lines of brittle manual COPYs (one per workspace package). - Single full install in deps (no --omit=dev) so build-time devDeps like tailwindcss/postcss are available — replaces the earlier hotfix that did a second install in the builder stage. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
PR SummaryMedium Risk Overview The Reviewed by Cursor Bugbot for commit 76851da. Configure here. |
Greptile SummaryThis PR replaces the hand-maintained Confidence Score: 5/5This PR is safe to merge — the change is a clean adoption of the standard turbo prune pattern with no logic or security issues. Single file changed, follows the established pattern already used in realtime.Dockerfile, turbo version is pinned, .dockerignore properly excludes sensitive files and node_modules, and the PR author reports successful CI builds on both amd64 and arm64. No P0 or P1 findings. No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
CTX[Build Context\n.dockerignore filters out\n.env*, node_modules, out/] --> BASE
BASE[base\noven/bun:1.3.13-slim\n+ Node.js 22]
BASE --> PRUNER[pruner\nbun install -g turbo@2.9.6\nCOPY . .\nturbo prune sim --docker]
PRUNER --> |out/json/\npruned package.json files| DEPS
PRUNER --> |out/bun.lock| DEPS
PRUNER --> |out/full/\npruned source tree| BUILDER
BASE --> DEPS[deps\nbun install --linker=hoisted\nno --omit=dev\nnode-gyp rebuild isolated-vm]
DEPS --> |node_modules| BUILDER
BASE --> BUILDER[builder\nbun run build\nturbo run build\nnext build]
BUILDER --> |.next/standalone\n.next/static\npublic/| RUNNER
BASE --> RUNNER[runner\nnon-root nextjs user\nbun apps/sim/server.js]
Reviews (2): Last reviewed commit: "chore(docker): pin turbo to 2.9.6 in pru..." | Re-trigger Greptile |
Match the version locked in package.json so pruner output is reproducible across builds. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
|
@greptile |
|
@cursor review |
There was a problem hiding this comment.
✅ Bugbot reviewed your changes and found no new issues!
Comment @cursor review or bugbot run to trigger another review on this PR
Reviewed by Cursor Bugbot for commit 76851da. Configure here.
* 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> * chore(ci): bump deprecated Node.js 20 actions to Node.js 24 versions GitHub Actions runners emit deprecation warnings for actions still on the Node.js 20 runtime. Node.js 20 will be force-upgraded by GitHub on 2026-06-02 and removed on 2026-09-16. Bumps to the latest stable major versions, all of which use Node.js 24: - actions/cache: v4 -> v5 - actions/setup-node: v4 -> v6 - aws-actions/configure-aws-credentials: v4 -> v6 - docker/login-action: v3 -> v4 All require GHA runner v2.327.1+ which Blacksmith already runs. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
Summary
Refactors
docker/app.Dockerfileto useturbo prune sim --dockerinstead of hand-maintaining a list ofCOPY packages/*/package.jsonlines. This matches the canonical Vercel/Turborepo monorepo Docker pattern and our existingrealtime.Dockerfile.Supersedes #4321 — that PR is a hotfix that adds a second `bun install` in the builder stage to recover devDependencies. This PR removes the need for that workaround entirely by installing the full dep set once in the `deps` stage against pruned manifests.
What changed
Why this is the right pattern
Test plan