From fbfe1df349872b354a8cf336f77746a304612d19 Mon Sep 17 00:00:00 2001 From: clawbot Date: Fri, 7 Aug 2026 17:46:37 +0200 Subject: [PATCH] frontend: gate the Docker build on make check (closes #11) (#12) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Resolves #11. The frontend/root `Dockerfile` ran only `RUN yarn build`, so `script/lint` and `script/fmt-check` (prettier) never gated CI — only a broken build failed it. (`script/cibuild`'s comment even claimed "the Dockerfile runs make check", which was false.) The backend `Dockerfile.backend` already runs `make check`; nothing covered the frontend's lint/fmt-check. Change (single file, `Dockerfile`): - `apk add ... git` -> `apk add ... git make` (build stage needs `make`). - `RUN yarn build` -> `RUN make check` — which runs `script/test` (`yarn build`, producing `dist/`) then `script/lint` + `script/fmt-check`. `dist/` is still produced in one build (no redundant rebuild); the final nginx runtime image is unchanged. Verified via a fresh clone (a worktree's `.git` pointer breaks `vite`'s `git rev-parse`, so builds must come from a real checkout — as CI's `actions/checkout` provides): positive `docker build` succeeds with in-image `make check` green; a negative test (a prettier-violating but build-valid file) makes the build fail at `make check`, confirming CI now goes red on a check regression, not just a broken build. Left open for review (not merged). Co-authored-by: sneak Reviewed-on: https://git.eeqj.de/sneak/netwatch/pulls/12 Co-authored-by: clawbot Co-committed-by: clawbot --- Dockerfile | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index a5cae63..ed37836 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,9 +3,12 @@ FROM node@sha256:e4bf2a82ad0a4037d28035ae71529873c069b13eb0455466ae0bc13363826e3 WORKDIR /app COPY package.json yarn.lock ./ RUN yarn install --frozen-lockfile -RUN apk add --no-cache git +RUN apk add --no-cache git make COPY . . -RUN yarn build +# make check runs script/check (test + lint + fmt-check); its test step +# is the production yarn build, so this both produces dist/ and gates the +# image on lint/fmt-check/test regressions, not merely a broken build. +RUN make check # nginx:stable-alpine as of 2026-02-22 FROM nginx@sha256:15e96e59aa3b0aada3a121296e3bce117721f42d88f5f64217ef4b18f458c6ab