fix: update nginx WebSocket route and add multi-arch Go build support#24
Conversation
📝 WalkthroughWalkthroughTwo Go service Dockerfiles now cross-compile for the target platform, and the webapp nginx template updates the collab WebSocket proxy path to ChangesDoclet multi-arch and WebSocket fixes
Estimated code review effort: 1 (Trivial) | ~5 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
LakshanSS
left a comment
There was a problem hiding this comment.
@BlackPool25
We need to use below format to fix the DCO check
git commit -s -m "your message"
d523148 to
f9d4a6d
Compare
Heyyy I've updated the commit with the signoff please check it out |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
project-doclet-app/service-go-document/Dockerfile (1)
1-1: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick winMissing non-root
USERin runtime stage is pre-existing.Trivy flags DS-0002 (no
USERdirective), but the runtime stage (lines 11-14) is unchanged by this PR, so this predates the multi-arch fix. Worth addressing separately since the file is already being touched.Also applies to: 11-14
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@project-doclet-app/service-go-document/Dockerfile` at line 1, The Dockerfile runtime stage is still missing a non-root USER directive, which Trivy flags as DS-0002. Update the final runtime stage of this Dockerfile to create/use a non-root account and switch to it with a USER directive, keeping the multi-arch builder change in place and applying the fix in the runtime section rather than the builder stage.Source: Linters/SAST tools
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@project-doclet-app/service-go-collab/Dockerfile`:
- Line 1: The runtime stage still runs the app as root, so update the
Dockerfile’s final stage to use a non-root account before the CMD. Add or reuse
a suitable user in the runtime stage and switch with a USER instruction in the
final image, ensuring the container starts under that account instead of root.
---
Nitpick comments:
In `@project-doclet-app/service-go-document/Dockerfile`:
- Line 1: The Dockerfile runtime stage is still missing a non-root USER
directive, which Trivy flags as DS-0002. Update the final runtime stage of this
Dockerfile to create/use a non-root account and switch to it with a USER
directive, keeping the multi-arch builder change in place and applying the fix
in the runtime section rather than the builder stage.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: a4d583db-5793-4227-8996-9aabc9158809
📒 Files selected for processing (3)
project-doclet-app/service-go-collab/Dockerfileproject-doclet-app/service-go-document/Dockerfileproject-doclet-app/webapp-react-frontend/nginx.conf.template
🚧 Files skipped from review as they are similar to previous changes (1)
- project-doclet-app/webapp-react-frontend/nginx.conf.template
Apply two uncommitted fixes from the doclet bring-up: - Change collab proxy_pass from / to /ws so WebSocket upgrades reach the correct route - Add --platform=$BUILDPLATFORM, ARG TARGETOS/TARGETARCH, and cross-compilation flags to both Go Dockerfiles for multi-arch builds without QEMU emulation - Run runtime stage as non-root user (Trivy DS-0002) Fixes openchoreo/openchoreo#4029 Signed-off-by: Shreyas Joshi <shreyasjoshi2511@gmail.com>
f9d4a6d to
a749c21
Compare
Mirage20
left a comment
There was a problem hiding this comment.
PR looks good. I am merging now. Thank you for the PR @BlackPool25.
|
Glad to contribute :) |
Description
Two doclet fixes that were baked into ghcr images but never committed to source.
Changes
project-doclet-app/webapp-react-frontend/nginx.conf.template:proxy_pass/→/wsso WebSocket upgrades reach the collab service route.project-doclet-app/service-go-document/Dockerfile: Multi-arch build support (--platform=$BUILDPLATFORM,ARG TARGETOS/ARG TARGETARCH,GOOS=$TARGETOS GOARCH=$TARGETARCH) and non-rootUSER.project-doclet-app/service-go-collab/Dockerfile: Same multi-arch and non-root fixes.Testing
Both Dockerfiles build successfully with
docker build --build-arg TARGETOS=linux --build-arg TARGETARCH=amd64.docker buildx build --platform linux/amd64,linux/arm64should also succeed for both Go services (cross-compilation avoids QEMU).Related Issues
Fixes openchoreo/openchoreo#4029