Skip to content

Add CI check for Dockerfile build performance #48

@RudoiDmytro

Description

@RudoiDmytro

Description

Add a CI check to ui-toolkit that measures and gates Dockerfile build performance — build time, final image size, and layer/cache efficiency — on every PR that modifies a Dockerfile.

This is one of three parallel issues (one per repo: ui-toolkit, crm, website). Implement the check once as a reusable workflow / composite action (hosted centrally, e.g. VilnaCRM-Org/.github) and consume it here, so the repos share one implementation instead of copy-pasting.

Context / lesson learned: Alpine/musl is not always viable — Playwright's bundled browsers are glibc builds, so this repo's Playwright runner uses mcr.microsoft.com/playwright:*-jammy. The check must reward smaller/faster images while allowing documented, justified exceptions (glibc-only toolchains) rather than hard-mandating Alpine.

Dockerfiles in this repo

Tasks

  • Adopt the shared reusable workflow (workflow_call) / composite action for Dockerfile performance (or help author it in VilnaCRM-Org/.github if not yet created).
  • Wire it into this repo's PR CI for the Dockerfiles listed above.
  • Configure per-image size budget + tolerance; report build time and final image size; gate layer efficiency (dive --ci) and hadolint best-practice/perf rules.
  • Emit a PR summary/comment with before/after image size and build time vs. the base branch.
  • Support a documented exception mechanism (PR label or # perf-exception: <reason> marker) for images that legitimately can't be slimmed (e.g. the glibc-bound Playwright runner).
  • Document the policy, thresholds, and exception process in CONTRIBUTING/docs.

Acceptance Criteria

  • On a PR that modifies a Dockerfile, CI reports build time and final image size and the delta vs. the target branch.
  • CI fails when an image exceeds its size budget (or the layer-efficiency / hadolint gate) beyond the configured tolerance, unless a documented exception applies.
  • Documented exceptions (e.g. the glibc-bound Playwright image) pass without weakening the check for other images.
  • The check is the shared reusable workflow consumed across ui-toolkit, crm, and website (no per-repo duplication).
  • Policy and thresholds are documented in this repo.

Related

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions