Feat: optimize Dockerfile of frontend#2453
Conversation
|
@mustafa-sayyed is attempting to deploy a commit to the Arc53 Team on Vercel. A member of the Team first needs to authorize it. |
There was a problem hiding this comment.
Pull request overview
This PR replaces the frontend container’s Vite dev-server workflow with a multi-stage Docker build that compiles the React app and serves the generated dist assets from a smaller node:22-alpine image. In the codebase, this changes how the frontend container is built and run for all Docker-based frontend deployments.
Changes:
- Switches the frontend image to a multi-stage
node:22-alpinebuild. - Replaces
npm installwithnpm ciand adds a production build step. - Replaces
npm run dev -- --hostwithserve -s dist -l 5173.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
|
Hey @dartpain , @ManishMadan2882 I have optimized the Dockerfile of frontend, it now only takes 104 MB But it breaks with the existing Docker compose setup The Dockerfile is good for Production, not for Development, as it doesn't sync with the source, doesn't take runtime env vars We can solve this issue using the multi-stage build itselfPlan
|
|
I have implemented the PLAN, Please review |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 6 out of 6 changed files in this pull request and generated 5 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| FROM nginx:alpine AS production | ||
|
|
||
| COPY --from=build /app/dist /usr/share/nginx/html | ||
|
|
||
| COPY nginx.conf /etc/nginx/conf.d/default.conf |
|
Review from GitHub Copilot:
I have fixed all things, what your thoughts ? |
Fixes #2452
Edited: