Skip to content

docker: add multi-stage Dockerfile for ws service#10

Open
Shubham-Aswekar wants to merge 3 commits intohemanth5544:mainfrom
Shubham-Aswekar:dockerize-ws
Open

docker: add multi-stage Dockerfile for ws service#10
Shubham-Aswekar wants to merge 3 commits intohemanth5544:mainfrom
Shubham-Aswekar:dockerize-ws

Conversation

@Shubham-Aswekar
Copy link

@Shubham-Aswekar Shubham-Aswekar commented Feb 5, 2026

What this PR does

  • Adds a Dockerfile for the ws (WebSocket) service
  • Builds the ws server using npm workspaces
  • Ensures the internal @quick-sync/logger dependency is resolved via workspace:*
  • Produces a runnable container for the ws service

Notes

  • This PR focuses only on containerizing the ws service
  • API and other services are handled in separate PRs
  • Logger is treated as an internal workspace dependency (not published)

How to run

docker build -f apps/ws/Dockerfile -t quicksync-ws .
docker run -p 3000:3000 quicksync-ws

Summary by CodeRabbit

  • Chores
    • Added containerization for API (port 2000) and WebSocket (port 3000) services using multi-stage builds for smaller, faster images
    • Included production-ready runtime setup with a non-root user for improved security
    • Updated workspace dependency handling to ensure consistent local package integration and removed an unused package dependency

@coderabbitai
Copy link

coderabbitai bot commented Feb 5, 2026

📝 Walkthrough

Walkthrough

Adds multi-stage Dockerfiles for apps/api and apps/ws and updates app package.json files to reference the monorepo @quick-sync/logger using the workspace protocol; also removes @quick-sync/config from both apps' dependencies.

Changes

Cohort / File(s) Summary
API Dockerfile
apps/api/Dockerfile
Added multi-stage Dockerfile: builder uses node:20-alpine, installs deps and builds workspaces (@quick-sync/logger, @quick-sync/session-api); runtime copies artifacts, exposes port 2000, and sets npm run start.
WebSocket Dockerfile
apps/ws/Dockerfile
Added multi-stage Dockerfile: builder installs and builds workspaces (@quick-sync/logger, @quick-sync/ws-server); runtime uses node:20-alpine, copies artifacts, creates non-root nodejs user, sets ownership, exposes port 3000, and runs node dist/index.js.
Workspace dependency updates
apps/api/package.json, apps/ws/package.json
Changed @quick-sync/logger dependency from "*" to "workspace:*" and removed @quick-sync/config from both apps' dependencies.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 I hopped through layers, build then run,

Workspaces stitched so now we're one.
Ports set, users made, artifacts neat,
Logger shared — a monorepo treat! 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The PR title 'docker: add multi-stage Dockerfile for ws service' accurately describes the main change: adding a multi-stage Dockerfile for the ws service. However, the changeset also includes modifications to apps/api/Dockerfile and package.json changes for both apps/api and apps/ws, making the title partially incomplete.
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
  • Post copyable unit tests in a comment

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.

1 participant