feat: multi-stage Dockerfile to reduce addon image size#293
Draft
Copilot wants to merge 1 commit into
Draft
Conversation
Copilot created this pull request from a session on behalf of
lildude
June 17, 2026 17:58
View session
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The addon installs slowly because the final image was built directly
FROM ghostfolio/ghostfolio, inheriting yarn, build tooling, and OS packages that aren't needed at runtime (~302 MB compressed before our layers).Dockerfile — multi-stage build
ghostfolio-source):ghostfolio/ghostfolioused as source only — nothing lands in the final image except what's explicitly copiednode:22-bookworm-slim— the same clean base the upstream ghostfolio image itself uses; strips yarn, build tools, and all upstream cruftCOPY --from=ghostfolio-source --chown=node:node /ghostfolio /ghostfolio— only app files cross the stage boundary--no-install-recommendsonapt-get install;redis→redis-server(drops unused CLI);curlandopenssladded explicitly (previously inherited from base)Run script
yarn start:production→exec /ghostfolio/entrypoint.shnode main, without yarnexecmakes node a direct child of s6, improving signal handling and eliminating the yarn process overhead; yarn is no longer required in the imageBUILD_FROMbuild arg andbuild.jsonare unchanged — the ghostfolio source image is still pinned per-architecture as before.