From aa746177e5a73a73d04840356012b5610e81b285 Mon Sep 17 00:00:00 2001 From: clawbot Date: Tue, 10 Mar 2026 02:45:27 -0700 Subject: [PATCH] fix: decouple lint stage from web-builder in Dockerfile Remove COPY --from=web-builder from the lint stage so it can run independently and fail fast. Create placeholder files for the go:embed directive instead. The build stage still uses the real SPA assets from web-builder. Update README to reflect that lint no longer depends on web-builder. --- Dockerfile | 4 +++- README.md | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index 77c8fd8..273f53f 100644 --- a/Dockerfile +++ b/Dockerfile @@ -15,7 +15,9 @@ WORKDIR /src COPY go.mod go.sum ./ RUN go mod download COPY . . -COPY --from=web-builder /web/dist/ web/dist/ +# Create placeholder files so //go:embed dist/* in web/embed.go resolves +# without depending on the web-builder stage (lint should fail fast) +RUN mkdir -p web/dist && touch web/dist/index.html web/dist/style.css web/dist/app.js RUN make fmt-check RUN make lint diff --git a/README.md b/README.md index 08800c8..18d3ac4 100644 --- a/README.md +++ b/README.md @@ -1854,9 +1854,11 @@ The Dockerfile is a four-stage build: 1. **web-builder**: Installs Node dependencies and compiles the SPA (JSX → bundled JS via esbuild) into `web/dist/` 2. **lint**: Runs formatting checks and golangci-lint against the Go source - (with the built SPA assets copied in) + (uses empty placeholder files for `web/dist/` so it runs independently of + web-builder for fast feedback) 3. **builder**: Runs tests and compiles static `neoircd` and `neoirc-cli` - binaries (CLI built to verify compilation, not included in final image) + binaries with the real SPA assets from web-builder (CLI built to verify + compilation, not included in final image) 4. **final**: Minimal Alpine image with only the `neoircd` binary ### Binary