Skip to content

Use a dedicated Node build stage so Dependabot can manage Node version via Docker updates - #409

Merged
BenjaminMichaelis merged 3 commits into
mainfrom
copilot/node-install-vs-base-image
Aug 12, 2026
Merged

BenjaminMichaelis merged 3 commits into
mainfrom
copilot/node-install-vs-base-image

Conversation

Copilot AI commented Aug 12, 2026

Copy link
Copy Markdown

This change moves JS/CSS artifact compilation to a dedicated node stage so the Node runtime version is owned by the Docker FROM node:... reference. This makes Node version updates explicit and automatable through Dependabot’s Docker ecosystem updates.

  • Docker build topology

    • Added a node-build stage based on node:20-bookworm-slim.
    • Runs build-js.sh in that stage to produce frontend artifacts.
  • .NET build stage simplification

    • Removed in-stage Node/npm installation from the .NET SDK build stage.
    • Keeps the .NET stage focused on restore/publish.
  • Artifact handoff between stages

    • Copies generated frontend assets from node-build into src/Microsoft.TryDotNet/wwwroot/... before dotnet publish.
FROM node:20-bookworm-slim AS node-build
WORKDIR /App
COPY . ./
RUN --mount=type=cache,id=try-npm,target=/root/.npm /App/build-js.sh

FROM mcr.microsoft.com/dotnet/sdk:10.0-azurelinux3.0 AS build-env
# ...
COPY --from=node-build /App/src/Microsoft.TryDotNet/wwwroot/api /App/src/Microsoft.TryDotNet/wwwroot/api
COPY --from=node-build /App/src/Microsoft.TryDotNet/wwwroot/css /App/src/Microsoft.TryDotNet/wwwroot/css

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot AI changed the title Use dedicated Node build stage in Dockerfile Use a dedicated Node build stage so Dependabot can manage Node version via Docker updates Aug 12, 2026
Copilot AI and others added 2 commits August 12, 2026 16:21
Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
# Conflicts:
#	Dockerfile

Co-authored-by: BenjaminMichaelis <22186029+BenjaminMichaelis@users.noreply.github.com>
Copilot AI temporarily deployed to BuildAndUploadImage August 12, 2026 16:41 Inactive
@BenjaminMichaelis
BenjaminMichaelis marked this pull request as ready for review August 12, 2026 16:51
Copilot AI lite review requested due to automatic review settings August 12, 2026 16:51
@BenjaminMichaelis
BenjaminMichaelis merged commit 600349c into main Aug 12, 2026
11 checks passed
@BenjaminMichaelis
BenjaminMichaelis deleted the copilot/node-install-vs-base-image branch August 12, 2026 17:00

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR refactors the Docker build to compile frontend JS/CSS assets in a dedicated Node-based stage, so the Node runtime version is managed via the Docker FROM node:... reference (enabling Dependabot Docker ecosystem updates) while keeping the .NET SDK stage focused on restore/publish.

Changes:

  • Added a new node-build stage based on a Node image to run /App/build-js.sh.
  • Removed in-stage Node/npm installation from the .NET SDK build stage.
  • Copied generated frontend artifacts from the Node stage into src/Microsoft.TryDotNet/wwwroot/{api,css} before dotnet publish.

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

Comment thread Dockerfile
@@ -1,15 +1,18 @@
# syntax=docker/dockerfile:1
FROM node:24-bookworm-slim AS node-build
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