From 91da9eb8c76bbff3ac454357895d8b07945e3945 Mon Sep 17 00:00:00 2001 From: user Date: Mon, 9 Mar 2026 17:35:19 -0700 Subject: [PATCH] docs: update README project structure and Dockerfile description - Remove web/dist/ individual files from project structure (now generated at Docker build time, not committed) - Add web/src/, build.sh, package.json, package-lock.json to structure - Update Dockerfile description from two-stage to four-stage build (web-builder, lint, builder, final) - Remove outdated example Dockerfile snippet --- README.md | 40 ++++++++++++++++------------------------ 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/README.md b/README.md index 9ff2502..08800c8 100644 --- a/README.md +++ b/README.md @@ -1850,26 +1850,14 @@ docker run -p 8080:8080 \ neoirc ``` -The Dockerfile is a multi-stage build: -1. **Build stage**: Compiles `neoircd` and `neoirc-cli` (CLI built to verify - compilation, not included in final image) -2. **Final stage**: Alpine Linux + `neoircd` binary only - -```dockerfile -FROM golang:1.24-alpine AS builder -WORKDIR /src -RUN apk add --no-cache make -COPY go.mod go.sum ./ -RUN go mod download -COPY . . -RUN go build -o /neoircd ./cmd/neoircd/ -RUN go build -o /neoirc-cli ./cmd/neoirc-cli/ - -FROM alpine:latest -COPY --from=builder /neoircd /usr/local/bin/neoircd -EXPOSE 8080 -CMD ["neoircd"] -``` +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) +3. **builder**: Runs tests and compiles static `neoircd` and `neoirc-cli` + binaries (CLI built to verify compilation, not included in final image) +4. **final**: Minimal Alpine image with only the `neoircd` binary ### Binary @@ -2318,10 +2306,14 @@ neoirc/ │ └── http.go # HTTP timeouts ├── web/ │ ├── embed.go # go:embed directive for SPA -│ └── dist/ # Built SPA (vanilla JS, no build step) -│ ├── index.html -│ ├── style.css -│ └── app.js +│ ├── build.sh # SPA build script (esbuild, runs in Docker) +│ ├── package.json # Node dependencies (preact, esbuild) +│ ├── package-lock.json +│ ├── src/ # SPA source files (JSX + HTML + CSS) +│ │ ├── app.jsx +│ │ ├── index.html +│ │ └── style.css +│ └── dist/ # Generated at Docker build time (not committed) ├── schema/ # JSON Schema definitions (planned) ├── go.mod ├── go.sum