feat(webui): multi-stage build, omit dev deps, pre-build env-generator#492
Open
maany wants to merge 1 commit intorucio:release-38-LTSfrom
Open
feat(webui): multi-stage build, omit dev deps, pre-build env-generator#492maany wants to merge 1 commit intorucio:release-38-LTSfrom
maany wants to merge 1 commit intorucio:release-38-LTSfrom
Conversation
Split the Dockerfile into a builder stage (git clone + npm install) and a runtime stage, removing git and its transitive dependencies from the final image. Use --omit=dev to exclude dev dependencies from production. Pre-build the env-generator tool during docker build so it no longer needs to compile at container startup. Replace wget with curl in the entrypoint since wget is no longer installed.
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.
Summary
Backport of #491 for release-38 webui containers.
npm install --omit=devto exclude dev dependencies from production, reducing image size and attack surfacetools/env-generatorTypeScript tool at image build time instead of compiling at every container startupwgetwithcurlin the entrypoint since wget is no longer installedSecurity scan results (Docker Scout)
release-38.3.0(before)Remaining vulnerabilities
7 HIGH — all packaged inside Next.js (
next/dist/compiled/tar,next/dist/compiled/glob,next/dist/compiled/cross-spawn). These are pre-compiled into the Next.js package and cannot be fixed via npm overrides. Requires a Next.js version upgrade in the webui repo. For release 38, this would result in breaking changes.20 of 26 MEDIUM — perl CVE-2023-47038 reported across 20 sub-packages. These are false positives: Docker Scout matches on the perl version (
5.32.1) without checking the RPM release suffix (-481.1.el9_6) which contains the backported fix from ALSA-2024:2228. The installed version5.32.1-481.1.el9_6is newer than the fixed version5.32.1-481.el9. Trivy correctly reports 0 OS-level HIGH/CRITICAL CVEs on the same image. Perl remains in the image as a runtime dependency ofpatchutils(providesfilterdiffused in the entrypoint for patch application).