Skip to content

Conversation

rare-magma
Copy link

@rare-magma rare-magma commented Aug 30, 2025

Pull Request Checklist

Note to first-time contributors: Please open a discussion post in Discussions and describe your changes before submitting a pull request.

Before submitting, make sure you've checked the following:

  • Target branch: Please verify that the pull request targets the dev branch.
  • Description: Provide a concise description of the changes made in this pull request.
  • Changelog: Ensure a changelog entry following the format of Keep a Changelog is added at the bottom of the PR description.
  • Documentation: Have you updated relevant documentation Open WebUI Docs, or other documentation sources?
  • Dependencies: Are there any new dependencies? Have you updated the dependency versions in the documentation?
  • Testing: Have you written and run sufficient tests to validate the changes?
  • Code review: Have you performed a self-review of your code, addressing any coding standard issues and ensuring adherence to the project's coding standards?
  • Prefix: To clearly categorize this pull request, prefix the pull request title using one of the following:
    • BREAKING CHANGE: Significant changes that may affect compatibility
    • build: Changes that affect the build system or external dependencies
    • ci: Changes to our continuous integration processes or workflows
    • chore: Refactor, cleanup, or other non-functional code changes
    • docs: Documentation update or addition
    • feat: Introduces a new feature or enhancement to the codebase
    • fix: Bug fix or error correction
    • i18n: Internationalization or localization changes
    • perf: Performance improvement
    • refactor: Code restructuring for better maintainability, readability, or scalability
    • style: Changes that do not affect the meaning of the code (white space, formatting, missing semi-colons, etc.)
    • test: Adding missing tests or correcting existing tests
    • WIP: Work in progress, a temporary label for incomplete or ongoing work

Changelog Entry

Description

  • This PR will reduce the docker image size by ~1.2GB. This reduction is the result of squashing multiple RUN instructions into one and uninstalling build dependencies (uv git build-essential gcc python3-dev). It will also bump the frontend alpine base image to 3.22 (3.20 is end of life in ~6 months)

Changed

  • Reduced docker image size

Additional Information

  • In a Dockerfile, each RUN creates a new layer. Layers are immutable, and all files created in one layer are carried into the next, even if they are deleted later.
  • If the build dependencies are necessary during runtime then a smaller reduction in size can still be achieved by only joining the multiple RUN instructions.

Screenshots or Videos

  • [Attach any relevant screenshots or videos demonstrating the changes]

Contributor License Agreement

By submitting this pull request, I confirm that I have read and fully agree to the Contributor License Agreement (CLA), and I am providing my contributions under its terms.

Signed-off-by: rare-magma <rare-magma@posteo.eu>
@ShirasawaSama
Copy link
Contributor

ShirasawaSama commented Aug 30, 2025

I personally think that this makes it impossible to use Docker's layering mechanism. Every time the content of any file in the backend directory changes, it will be forced to rerun the apt install related commands. I feel that this will actually slow down. 🤔

@rare-magma
Copy link
Author

@ShirasawaSama if that is a requirement for this image then it might be better to set up a multi stage build for the backend then

@tjbck tjbck closed this Aug 31, 2025
@tjbck tjbck reopened this Aug 31, 2025
@tjbck
Copy link
Contributor

tjbck commented Aug 31, 2025

Agreed with @ShirasawaSama here, we'll definitely need some middle ground here.

@tjbck tjbck closed this Aug 31, 2025
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.

3 participants