docs: update README project structure and Dockerfile description
All checks were successful
check / check (push) Successful in 4s

- 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
This commit is contained in:
user
2026-03-09 17:35:19 -07:00
parent 4b2888cb90
commit 91da9eb8c7

View File

@@ -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