Skip to content

fix: correct server.js path in Dockerfile CMD for standalone build#3098

Open
octo-patch wants to merge 1 commit intoonlook-dev:mainfrom
octo-patch:fix/issue-3046-dockerfile-standalone-server-path
Open

fix: correct server.js path in Dockerfile CMD for standalone build#3098
octo-patch wants to merge 1 commit intoonlook-dev:mainfrom
octo-patch:fix/issue-3046-dockerfile-standalone-server-path

Conversation

@octo-patch
Copy link
Copy Markdown

@octo-patch octo-patch commented Apr 18, 2026

Fixes #3046

Problem

The Dockerfile CMD instruction referenced apps/web/client/server.js, which does not exist after a Next.js standalone build. When running the Docker image, bun throws:

error: Module not found "apps/web/client/server.js"

Solution

Updated the CMD path to match the actual standalone build output location:

apps/web/client/.next/standalone/apps/web/client/server.js

This matches what the start:standalone script in apps/web/client/package.json already uses:

"start:standalone": "bun .next/standalone/apps/web/client/server.js"

The build:standalone script copies assets into .next/standalone/apps/web/client/, so the server entry point is always at that path when building from the monorepo root.

Testing

The fix aligns the Dockerfile CMD with the existing start:standalone npm script, which is the canonical way to start the standalone server.

Summary by CodeRabbit

  • Chores
    • Updated Docker container startup configuration to reference the optimized standalone build output location, ensuring proper application initialization and consistent deployment behavior across environments.

…ixes onlook-dev#3046)

The CMD instruction referenced apps/web/client/server.js, which does not
exist after a Next.js standalone build. The correct output path is
apps/web/client/.next/standalone/apps/web/client/server.js, matching
the start:standalone script in apps/web/client/package.json.
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 18, 2026

Someone is attempting to deploy a commit to the Onlook Team on Vercel.

A member of the Team first needs to authorize it.

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 18, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 02d6bb00-80e2-461e-8491-42174cd72ff8

📥 Commits

Reviewing files that changed from the base of the PR and between a242be5 and 72f4122.

📒 Files selected for processing (1)
  • Dockerfile

📝 Walkthrough

Walkthrough

Updated the Dockerfile to reference the correct Next.js server path in the standalone build output directory. The container startup command now points to apps/web/client/.next/standalone/apps/web/client/server.js instead of the non-existent apps/web/client/server.js, resolving the module not found error.

Changes

Cohort / File(s) Summary
Docker Configuration
Dockerfile
Updated CMD instruction to reference the Next.js server at the correct standalone build output path instead of the previous incorrect path.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~2 minutes

Poem

🐰 A hop, a skip, a path corrected,
The Docker logs no longer vexed,
To .next/standalone we now stride,
The server runs with proper pride! 🚀
No modules lost, no errors more,
Just smooth deployments we adore!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely describes the main change: correcting the server.js path in the Dockerfile CMD for standalone build.
Description check ✅ Passed The description includes the related issue, problem statement, solution with code examples, and testing notes. All required sections are present and well-documented.
Linked Issues check ✅ Passed The PR directly addresses the objective of issue #3046 by correcting the Dockerfile CMD path from the non-existent location to the actual standalone build output.
Out of Scope Changes check ✅ Passed The change is narrowly scoped to fixing the Dockerfile CMD path and is directly related to resolving the linked issue #3046.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

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.

docker logs “error: Module not found "apps/web/client/server.js"”

1 participant