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

Feature: Dockerfile Organization & Enhancements #888

Merged
merged 1 commit into from
May 6, 2022

Conversation

stumpylog
Copy link
Member

Proposed change

This PR accomplishes a few improvements to our Dockerfile, with no functional changes and at least a few MBs of image size shaved off.

First, the Dockerfile is now roughly ordered in order from least changing (jbig2enc) to most changing (back and front ends). Anytime a layer changes, following layers must re-run, so this ordering helps reduce the churn a bit.

Although with the registry caching the build is pretty quick, when there is a change to requirements.txt (so every Monday), all the runtime packages are also re-installed. This change de-couples the Python requirements from the system requirements.

Finally, the buildkit syntax has support for a RUN command which can mount either local or image file systems into the build. This means instead of copying the library of installers, they can be mounted, run and unmounted, instead of being left taking up space in the final image.

There should be zero functional changes. I've successfuly loaded documents, run management commands and accessed the webui without issue.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Other (please explain)

Checklist:

  • I have read & agree with the contributing guidelines.
  • If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
  • If applicable, I have checked that all tests pass, see documentation.
  • I have run all pre-commit hooks, see documentation.
  • I have made corresponding changes to the documentation as needed.
  • I have checked my modifications for any breaking changes.

…g. Uses RUN bind mounts to avoid copies of the installer being included in the final image
@paperless-ngx-secretary paperless-ngx-secretary bot added the non-trivial Requires approval by several team members label May 6, 2022
Copy link
Member

@qcasey qcasey left a comment

Choose a reason for hiding this comment

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

This is sensible, and still builds+consumes locally for me.

@shamoon
Copy link
Member

shamoon commented May 6, 2022

Yea looks good (not that I can pretend to understand 100% of it but it works for me too)!

Appreciate your constant improvements! Also an auspicious PR number 👍

@shamoon shamoon merged commit f0ee2e1 into dev May 6, 2022
@shamoon shamoon deleted the feature-docker-improvements branch May 6, 2022 21:45
@github-actions
Copy link
Contributor

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new discussion or issue for related concerns.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 17, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
ci-cd deployment enhancement New feature non-trivial Requires approval by several team members
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

3 participants