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

Pre-install all Node.JS dependencies to make image smaller/faster #2148

Merged
merged 1 commit into from
Feb 10, 2025

Conversation

benoit74
Copy link
Contributor

@benoit74 benoit74 commented Jan 30, 2025

Since Node.JS dependencies rarely need to be changed during successive builds of the Docker image, it is way better to first install only dependencies without mwoffliner code, and then install mwoffliner itself. Any change to the codebase will hence only update few things without having to re-download again all dependencies.

Edit: to be merged to main once #2143 is merged

@benoit74 benoit74 added this to the 1.14.1 milestone Jan 30, 2025
@benoit74 benoit74 requested a review from kelson42 January 30, 2025 15:00
@benoit74 benoit74 self-assigned this Jan 30, 2025
Copy link

codecov bot commented Jan 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 75.63%. Comparing base (0dcef0b) to head (370ca59).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2148      +/-   ##
==========================================
+ Coverage   75.31%   75.63%   +0.31%     
==========================================
  Files          41       41              
  Lines        3213     3213              
  Branches      704      704              
==========================================
+ Hits         2420     2430      +10     
+ Misses        672      666       -6     
+ Partials      121      117       -4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@kelson42
Copy link
Collaborator

@benoit74 Great PR. I will test it this WE, but I would really appreciate @audiodude expertise in the review work.

Copy link
Collaborator

@kelson42 kelson42 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Base automatically changed from images_processing to main February 10, 2025 09:45
Since Node.JS dependencies rarely need to be changed during successive
builds of the Docker image, it is way better to first install only
dependencies without mwoffliner code, and then install mwoffliner
itself. Any change to the codebase will hence only update few things
without having to re-download again all dependencies.
@benoit74 benoit74 force-pushed the faster_docker_build branch from 5e79ba0 to 370ca59 Compare February 10, 2025 09:46
@benoit74 benoit74 merged commit f1c641e into main Feb 10, 2025
6 checks passed
@benoit74 benoit74 deleted the faster_docker_build branch February 10, 2025 10:29
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.

2 participants