Skip to content

feat(ci): Publish UI as lightweight container image#59

Merged
nfebe merged 3 commits intomainfrom
ci/docker-image
Apr 18, 2026
Merged

feat(ci): Publish UI as lightweight container image#59
nfebe merged 3 commits intomainfrom
ci/docker-image

Conversation

@nfebe
Copy link
Copy Markdown
Contributor

@nfebe nfebe commented Apr 18, 2026

The dashboard UI is now shipped as a public container image on GHCR in addition to the existing dist archive. Pushes to main publish an image tagged with the short commit SHA; published releases publish versioned tags plus latest for non-prereleases.

Images carry standard OCI metadata (title, description, vendor, licenses, source, documentation, revision, version, created) so the image is self-describing when inspected or browsed on GHCR.

The dashboard UI is now shipped as a public container image on GHCR
in addition to the existing dist archive. Pushes to main publish an
image tagged with the short commit SHA; published releases publish
versioned tags plus latest for non-prereleases.

Images carry standard OCI metadata (title, description, vendor,
licenses, source, documentation, revision, version, created) so the
image is self-describing when inspected or browsed on GHCR.
@sourceant
Copy link
Copy Markdown

sourceant Bot commented Apr 18, 2026

Code Review Summary

The PR successfully introduces a robust containerization strategy for the UI component. It leverages GitHub Actions for automated publishing to GHCR with proper versioning and OCI metadata.

🚀 Key Improvements

  • Implemented multi-stage Docker build to keep the production image lightweight.
  • Configured Nginx with SPA routing and optimized caching for static assets.
  • Integrated docker/metadata-action for automated semantic versioning of images.

💡 Minor Suggestions

  • Pin base image versions to specific tags for better reproducibility.
  • Enhance Nginx Cache-Control for assets with the immutable directive.

Copy link
Copy Markdown

@sourceant sourceant Bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

Comment thread .github/workflows/docker-image.yml Outdated
Comment thread nginx.conf Outdated
@cloudflare-workers-and-pages
Copy link
Copy Markdown

cloudflare-workers-and-pages Bot commented Apr 18, 2026

Deploying flatrun-ui with  Cloudflare Pages  Cloudflare Pages

Latest commit: e6f0ebf
Status: ✅  Deploy successful!
Preview URL: https://add4748d.flatrun-ui.pages.dev
Branch Preview URL: https://ci-docker-image.flatrun-ui.pages.dev

View logs

nfebe added 2 commits April 18, 2026 01:47
Package visibility is set once in the GHCR package settings and
persists across pushes, matching how the webservice image is handled.
The extra API call added noise and required elevated token scopes
that the default workflow token does not carry.
Index now allows conditional revalidation so returning visitors reuse
the cached shell on 304s instead of re-downloading it every load.
Static assets cache for thirty days instead of a year, giving a sane
recovery window if a mishashed asset ever slips into a release.
Copy link
Copy Markdown

@sourceant sourceant Bot left a comment

Choose a reason for hiding this comment

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

Review complete. See the overview comment for a summary.

Comment thread Dockerfile
@@ -0,0 +1,22 @@
# syntax=docker/dockerfile:1

FROM node:22-alpine AS build
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

It is recommended to use a specific SHA or a more granular version tag for the build stage to ensure build reproducibility over time. While 22-alpine is relatively stable, it can still receive updates that might break builds.

Suggested change
FROM node:22-alpine AS build
FROM node:22.11.0-alpine AS build

Comment thread nginx.conf

location /assets/ {
expires 30d;
add_header Cache-Control "public";
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

When using add_header, Nginx inherits headers from the outer scope only if no headers are defined in the current scope. Adding Cache-Control here might suppress other security headers if they were defined at the server level later. It's best to be explicit with the full policy.

Suggested change
add_header Cache-Control "public";
add_header Cache-Control "public, max-age=2592000, immutable";

@nfebe nfebe merged commit a49c7e5 into main Apr 18, 2026
5 checks passed
@nfebe nfebe deleted the ci/docker-image branch April 18, 2026 00:49
@nfebe nfebe mentioned this pull request Apr 18, 2026
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