Skip to content

Conversation

@waleedlatif1
Copy link
Collaborator

Summary

Apply the same --linker=hoisted fix from #2637 to app.Dockerfile.

Bun 1.3+ defaults to isolated linker mode which stores packages in node_modules/.bun/ with symlinks. These symlinks break during Docker multi-stage COPY operations. Using --linker=hoisted restores the traditional flat node_modules layout.

Changes:

  • Added --linker=hoisted to bun install commands
  • Simplified isolated-vm path from node_modules/.bun/[email protected]/... to node_modules/isolated-vm

Type of Change

  • Bug fix

Testing

Build completes successfully; container starts normally.

Checklist

  • Code follows project style guidelines
  • Self-reviewed my changes
  • Tests added/updated and passing
  • No new warnings introduced
  • I confirm that I have read and agree to the terms outlined in the ./CONTRIBUTING.md#contributor-license-agreement-cla

@vercel
Copy link

vercel bot commented Dec 31, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
docs Ready Ready Preview, Comment Dec 31, 2025 6:21am

@greptile-apps
Copy link
Contributor

greptile-apps bot commented Dec 31, 2025

Greptile Summary

Applies the same --linker=hoisted fix from PR #2637 to app.Dockerfile to resolve Docker build failures caused by Bun 1.3+ symlinks.

Changes:

  • Added --linker=hoisted flag to bun install commands on lines 33 and 69
  • Simplified isolated-vm module path from node_modules/.bun/[email protected]/node_modules/isolated-vm to node_modules/isolated-vm on lines 34 and 109
  • Added explanatory comment about Docker multi-stage build compatibility

Root cause: Bun 1.3+ defaults to isolated linker mode which stores packages in node_modules/.bun/ with symlinks. These symlinks break during Docker multi-stage COPY operations. The hoisted linker restores the traditional flat node_modules layout that Docker can copy correctly.

Consistency: This change mirrors the fix already applied to realtime.Dockerfile in PR #2637, ensuring consistent build behavior across all Docker containers in the project.

Confidence Score: 5/5

Important Files Changed

Filename Overview
docker/app.Dockerfile Added --linker=hoisted to bun install commands and simplified isolated-vm path from .bun/[email protected]/... to isolated-vm. Fixes symlink issues in Docker multi-stage builds.

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant Docker as Docker Build
    participant Deps as Deps Stage
    participant Builder as Builder Stage
    participant Runner as Runner Stage
    
    Dev->>Docker: docker build with app.Dockerfile
    
    Note over Docker,Deps: Dependencies Stage
    Docker->>Deps: bun install --linker=hoisted
    Note over Deps: Creates flat node_modules/<br/>instead of .bun/ symlinks
    Deps->>Deps: cd node_modules/isolated-vm
    Deps->>Deps: npx node-gyp rebuild
    Note over Deps: Compiles isolated-vm<br/>native module for Node.js
    
    Note over Docker,Builder: Builder Stage
    Docker->>Builder: COPY node_modules from deps
    Note over Builder: Successfully copies flat structure<br/>(no broken symlinks)
    Builder->>Builder: bun install sharp --linker=hoisted
    Builder->>Builder: bun run build
    
    Note over Docker,Runner: Runner Stage
    Docker->>Runner: COPY artifacts from builder
    Docker->>Runner: COPY node_modules/isolated-vm from deps
    Note over Runner: Direct path works<br/>(no .bun/ directory)
    Runner->>Dev: Container starts successfully
Loading

@waleedlatif1 waleedlatif1 merged commit b90cc5b into staging Dec 31, 2025
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants