Skip to content

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

Open
guangyang1206 wants to merge 1 commit into
onlook-dev:mainfrom
guangyang1206:fix/docker-logs-server-js-path-3046
Open

fix: correct server.js path in Dockerfile for standalone build#3107
guangyang1206 wants to merge 1 commit into
onlook-dev:mainfrom
guangyang1206:fix/docker-logs-server-js-path-3046

Conversation

@guangyang1206
Copy link
Copy Markdown

@guangyang1206 guangyang1206 commented May 15, 2026

The Dockerfile was pointing to apps/web/client/server.js which doesn't exist. The standalone build outputs to .next/standalone/apps/web/client/server.js.

Fixes #3046

Description

The Dockerfile was incorrectly pointing to apps/web/client/server.js which doesn't exist in the repository. When using standalone build output (STANDALONE_BUILD=true), Next.js outputs the server file to .next/standalone/apps/web/client/server.js.

This caused Docker builds to fail with error: "Module not found 'apps/web/client/server.js'"

Related Issues

Fixes #3046

Type of Change

  • Bug fix

Testing

  1. Build Docker image with the fixed Dockerfile
  2. Run the container
  3. Verify the application starts correctly on port 3000

Additional Notes

The start:standalone script in package.json already correctly references .next/standalone/apps/web/client/server.js, but the Dockerfile was using the wrong path.

Summary by CodeRabbit

  • Chores
    • Updated containerized application startup configuration to use an optimized server build output. Build steps, environment variables, port configuration, and health checks remain unchanged.

Review Change Stack

The Dockerfile was pointing to apps/web/client/server.js which doesn't exist.
The standalone build outputs to .next/standalone/apps/web/client/server.js.

Fixes onlook-dev#3046
@vercel
Copy link
Copy Markdown

vercel Bot commented May 15, 2026

@guangyang1206 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 May 15, 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: 18075080-3438-4e42-abde-c9694731d4d0

📥 Commits

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

📒 Files selected for processing (1)
  • Dockerfile

📝 Walkthrough

Walkthrough

The Dockerfile's container startup command is updated to run the Next.js standalone server from the build output path (.next/standalone/apps/web/client/server.js) instead of the source path (apps/web/client/server.js), fixing module-not-found errors at runtime.

Changes

Dockerfile Server Startup Path

Layer / File(s) Summary
Dockerfile server startup command
Dockerfile
The CMD instruction is updated to invoke the Next.js standalone server from the build output at .next/standalone/apps/web/client/server.js instead of attempting to run the source file apps/web/client/server.js.

🎯 1 (Trivial) | ⏱️ ~2 minutes

🐰 A standalone server born from build,
No more hunting files that don't exist,
The path now points where Next.js is distilled,
Container startup won't be missed! 🚀

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and specifically describes the main change: correcting the server.js path in the Dockerfile for standalone builds.
Description check ✅ Passed The description includes all key template sections: clear problem statement, related issues (Fixes #3046), type of change (Bug fix), testing steps, and additional context about alignment with package.json.
Linked Issues check ✅ Passed The PR directly addresses issue #3046 by correcting the Dockerfile path from apps/web/client/server.js to .next/standalone/apps/web/client/server.js, resolving the 'Module not found' error.
Out of Scope Changes check ✅ Passed The PR contains only the necessary Dockerfile path correction (+2/-2 lines); no unrelated changes or scope creep detected.
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

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


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