Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(cli): dockrize the application #698

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

MAVRICK-1
Copy link

Description

This PR introduces a Dockerfile with a multistage build for better performance and optimized image size. The Dockerfile separates the build environment from the runtime environment, ensuring a cleaner and more efficient Docker image.

Related Issues

Fixes #694

Changes Proposed

  • Added a multistage Dockerfile to separate the build and runtime environments.
  • The first stage uses a Node.js base image for installing dependencies and building the application.
  • The second stage copies only the necessary files from the build stage and uses a lighter base image (e.g., nginx) for serving the application.

Here is the Dockerfile structure:

# Build Stage
FROM node:16 AS build

WORKDIR /app

COPY package*.json ./
RUN npm install

COPY . .

RUN npm run build

# Production Stage
FROM nginx:alpine

COPY --from=build /app/dist /usr/share/nginx/html

EXPOSE 80
CMD ["nginx", "-g", "daemon off;"]

Checklist

Screenshots

Notes for Reviewers

Please review the changes related to the Docker multistage build. The idea is to ensure that the production image is optimized and that we are only copying the necessary files to the final image.

Copy link

stackblitz bot commented Jan 1, 2025

Review PR in StackBlitz Codeflow Run & review this pull request in StackBlitz Codeflow.

Copy link

vercel bot commented Jan 1, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
devdisplay ✅ Ready (Inspect) Visit Preview 💬 Add feedback Jan 1, 2025 6:04pm

@MAVRICK-1
Copy link
Author

@colemanscott98 review my PR and add the labels

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.

[Feat]: Dockerize the Application
1 participant