Skip to content

fix: docker node_modeles symlink path matching with pnpm path in live server#7605

Merged
sriramveeraghanta merged 1 commit intopreviewfrom
live-docker-node-modules-path
Aug 20, 2025
Merged

fix: docker node_modeles symlink path matching with pnpm path in live server#7605
sriramveeraghanta merged 1 commit intopreviewfrom
live-docker-node-modules-path

Conversation

@sriramveeraghanta
Copy link
Member

@sriramveeraghanta sriramveeraghanta commented Aug 20, 2025

Description

  • Maintain same path as app structure to retain pnpm symlinks

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Summary by CodeRabbit

  • Chores
    • Updated live Docker configuration to copy build output and dependencies into apps/live paths and start the service via node ./apps/live/dist/server.js.
    • Ensures the live service runs from the built distribution within apps/live and includes required node_modules for reliable container startup.
    • No user-facing changes.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 20, 2025

Walkthrough

Dockerfile for apps/live adjusts runner-stage copy destinations to apps/live paths, adds copying apps/live/node_modules, and updates the startup command to run node ./apps/live/dist/server.js. No other steps changed. No exported/public declarations affected.

Changes

Cohort / File(s) Summary
Docker runner path updates
apps/live/Dockerfile.live
Runner now copies build output to ./apps/live/dist and adds ./apps/live/node_modules. Startup command updated from node live/server.js to node ./apps/live/dist/server.js. Other steps unchanged.

Sequence Diagram(s)

sequenceDiagram
    autonumber
    participant Dev as Docker Build
    participant Img as Image (Runner Stage)
    participant Node as Node.js Runtime
    participant App as apps/live App

    Dev->>Img: Copy built dist -> ./apps/live/dist
    Dev->>Img: Copy node_modules -> ./apps/live/node_modules
    Note over Img: Image assembled with new paths

    Img->>Node: Start with CMD node ./apps/live/dist/server.js
    Node->>App: Load server.js from apps/live/dist
    App-->>Node: Initialize server
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • prateekshourya29
  • Prashant-Surya

Poem

Hop hop hooray, the paths align,
Dist now lives where nodes entwine.
A gentle nudge, a start that’s clean,
server.js where it should’ve been.
I thump my paw—container’s live!
With tidy trails, our bits arrive. 🐇🚀

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch live-docker-node-modules-path

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
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/live/Dockerfile.live (2)

56-57: Aligns paths with pnpm workspace; consider symlink instead of copying app-level node_modules to cut image size

Copying both root-level and app-level node_modules duplicates the dependency tree. A lightweight alternative is to symlink apps/live/node_modules to /app/node_modules in the runner stage, which still satisfies Node resolution and typical pnpm symlink expectations while avoiding duplication.

Apply this diff to replace the copy with a symlink:

 COPY --from=installer /app/apps/live/dist ./apps/live/dist
-COPY --from=installer /app/apps/live/node_modules ./apps/live/node_modules
 COPY --from=installer /app/node_modules ./node_modules
+RUN ln -s /app/node_modules /app/apps/live/node_modules

Note: If you choose to keep copying apps/live/node_modules, double-check that symlinks are preserved as intended in the final layer (and not dereferenced), otherwise you may lose the pnpm layout benefits. Also, if the live app relies on ESM via "type": "module", consider copying apps/live/package.json as well to ensure correct module type resolution at runtime.


64-64: Entry point path update looks correct; optionally enable source maps for better runtime diagnostics

The switch to apps/live/dist/server.js matches the new copy destination. For improved error stacks in production, you can enable source maps if your build emits them.

Apply this small tweak:

-CMD ["node", "apps/live/dist/server.js"]
+CMD ["node", "--enable-source-maps", "apps/live/dist/server.js"]

Optional: If the app expects process.cwd() to be apps/live, consider setting WORKDIR to /app/apps/live and running node dist/server.js instead, but that’s not required for correctness here.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 6636b88 and 3748bac.

📒 Files selected for processing (1)
  • apps/live/Dockerfile.live (1 hunks)

@sriramveeraghanta sriramveeraghanta merged commit 7e15fcc into preview Aug 20, 2025
4 of 5 checks passed
@sriramveeraghanta sriramveeraghanta deleted the live-docker-node-modules-path branch August 20, 2025 10:47
@coderabbitai coderabbitai bot mentioned this pull request Sep 3, 2025
2 tasks
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