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

Reducing cotainer size and add layer for optimize building for frontend #72

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

Rajgupta36
Copy link
Contributor

This PR reduce size and optimize the image by removing unnecessary build processes and introducing layering for better optimization. The changes are focused on reducing size , increasing performance, and reducing resource consumption.

Changes Made:

  1. Removed Build Process :- shifted the Tauri application build process to be executed directly in the bash terminal of container. This change allows for better control over the build process and results in smaller, more optimized images.

  2. Added dockerignore file :- image should contain only necessay file. not generated files by tauri like target and schemas also i excluded tsc generated folder.

  3. Introduce Layering :- i didn't make any changes in dockerfile. i just add package.json before the copying application process if package.json doesn't have any changes then it's cached all necessasy dependecies.

  COPY package.json package-lock.json ./
  RUN npm install
  COPY . .

Benefits :

  • Reduced image size
  • optimized building
  • low building time

Related issue :
closes #63

result:

image

Build Logs:

image

@Rajgupta36
Copy link
Contributor Author

@Pranav0-0Aggarwal , please check this pr.

@Rajgupta36
Copy link
Contributor Author

My goal was to keep the image size under 1GB, but due to required dependencies, achieving this wasn't possible for me . I've optimized it as much as possible. Let me know if you have suggestions for further optimizations.

@Rajgupta36 Rajgupta36 changed the title Reducing cotainer size and add layer for optimize building Reducing cotainer size and add layer for optimize building for frontend Nov 20, 2024
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.

Optimize Dockerfile for Reduced Size and Build Time
1 participant