Skip to content

feat(examples): Add Prisma Expressjs4.18 Node21 distroless - #355

Open
CKCatalin wants to merge 2 commits into
unikraft:mainfrom
CKCatalin:feat/add-prisma-expressjs4.18-node21-distroless
Open

CKCatalin wants to merge 2 commits into
unikraft:mainfrom
CKCatalin:feat/add-prisma-expressjs4.18-node21-distroless

Conversation

@CKCatalin

Copy link
Copy Markdown

Description

Added a Node.js (Express 4.18) and Prisma base example using the distroless container image cgr.dev/chainguard/node, which provides a minimal runtime environment. This example utilizes a multi-stage build, starting with node:22-bookworm-slim to install dependencies, generate the Prisma client, migrate and seed the database, and bundle the application using Webpack. It selectively copies the compiled application bundle and the generated Prisma engine into the final distroless image.

The README.md file contains instructions for building and running the example manually.

Automated Testing

This PR contains a three-stage workflow to build and test this example via GitHub Actions:

  1. Measuring the rootfs size (resulting in 219MB)
  2. Scanning for vulnerabilities using Trivy
  3. Validating the web application operations using curl on the /feed endpoint and matching the HTTP 200 status code

Note on Vulnerability Scanning:

Trivy scans are configured to pass by explicitly ignoring specific vulnerabilities via .trivyignore. CVE-2026-14456 (libssl3) is ignored because it affects OpenSSL QUIC servers, a feature that this simple application does not implement or utilize (exception expires on 2026-11-30).

Use cgr.dev/chainguard/node distroless image for full compatibility with Debian glibc builds. It sets PRISMA_CLIENT_ENGINE_TYPE=library and bundles the native query engine to avoid process-spawning crashes in Unikraft's single address space model.

Signed-off-by: Constantin-Cătălin Cojocaru <catalincojocaru4@gmail.com>
…ress server example

- Measure root file system size using du -sh
- Scan for vulnerabilities using Trivy
- Validate output using curl and grep

Signed-off-by: Constantin-Cătălin Cojocaru <catalincojocaru4@gmail.com>
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.

1 participant