Skip to content

fix: serve static assets with nginx instead of npm start#220

Open
KUNDAN1334 wants to merge 2 commits intokubeflow:mainfrom
KUNDAN1334:perf(centraldashboard)-serve-static-assets-with-nginx
Open

fix: serve static assets with nginx instead of npm start#220
KUNDAN1334 wants to merge 2 commits intokubeflow:mainfrom
KUNDAN1334:perf(centraldashboard)-serve-static-assets-with-nginx

Conversation

@KUNDAN1334
Copy link

Motivation

Current Dockerfile uses npm start (Node.js server) in production:

  • 900MB image size (node:16-alpine + 1604 npm packages)
  • Unnecessary runtime (webpack already builds static assets)
  • Larger attack surface (old Node.js deps with 154 vulns)

Changes

  • Dockerfile: Replace Node serve → nginx static serve
    FROM nginx:1.25-alpine AS serve  # ~10MB vs 900MB
    COPY --from=build /centraldashboard/public /usr/share/nginx/html
    

Closes #211

@google-oss-prow google-oss-prow bot added the area/dashboard area - related to central dashboard label Feb 22, 2026
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign kimwnasptd for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

- /dist → /public/ (actual webpack output)
- Copy app.bundle.js + app.css bundles
- nginx.conf SPA routing preserved"

Signed-off-by: KUNDAN1334 <kundan.22bcon1334@jecrcu.edu.in>
Signed-off-by: KUNDAN1334 <kundan.22bcon1334@jecrcu.edu.in>
@KUNDAN1334 KUNDAN1334 force-pushed the perf(centraldashboard)-serve-static-assets-with-nginx branch from 20a841e to 2125f79 Compare February 22, 2026 09:44
@KUNDAN1334 KUNDAN1334 changed the title perf(centraldashboard): serve static assets with nginx instead of npm start fix(centraldashboard): serve static assets with nginx Feb 22, 2026
@KUNDAN1334 KUNDAN1334 changed the title fix(centraldashboard): serve static assets with nginx fix: nginx static serve (90% smaller image) Feb 22, 2026
@KUNDAN1334 KUNDAN1334 changed the title fix: nginx static serve (90% smaller image) fix: serve static assets with nginx instead of npm start Feb 22, 2026
@christian-heusel
Copy link
Contributor

Did you test those changes by running the application?

@KUNDAN1334
Copy link
Author

Hey @christian-heusel

Thanks for review! Verified webpack → nginx flow:

Local verification:

npm run build → Static assets generated ✓
app.bundle.js (1.34MB)
app.css (31.5 KiB)
public/index.html + assets/

Screenshot 2026-02-22 182903 Screenshot 2026-02-22 182919

@christian-heusel
Copy link
Contributor

@KUNDAN1334 nice, thats already good to know! 🤗 please also test the UI itself and not just the outputs of the CLI tools 👍🏻

@KUNDAN1334
Copy link
Author

@christian-heusel ! Full UI test complete on Mac M4 + Kind v1.35.0

Test Environment:
Kind cluster (minimal): kf-test-control-plane
nginx image: localhost:5000/centraldashboard:nginx-test (65MB vs ~900MB original)
Deployment: centraldashboard → 1/1 Running (6m+)
Port-forward: localhost:8082

Screenshot 2026-02-24 at 10 12 00 PM Screenshot 2026-02-24 at 10 12 22 PM Screenshot 2026-02-24 at 10 10 15 PM

Note: Empty panels expected in standalone deployment - only centraldashboard running (no Notebooks/Pipelines backend services deployed). Core UI + nginx static serving verified

@KUNDAN1334
Copy link
Author

any update @christian-heusel ??

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/dashboard area - related to central dashboard size/M

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Drop npm (and possibly node) as runtime dependency of kubeflow/dashboard

2 participants