- Replace nginx+Chart.js client-side dashboard with Go server - Server-side rendered SVG charts (donut, line charts) - Direct Docker socket integration via Go stdlib - Embedded HTML template via //go:embed - Minimal scratch image (~9MB total) - Remove nginx.conf and client-side Chart.js
12 lines
304 B
Docker
12 lines
304 B
Docker
# ── Build stage ──
|
|
FROM golang:1.24-alpine AS builder
|
|
WORKDIR /build
|
|
COPY infra/dashboard/ ./
|
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o dashboard .
|
|
|
|
# ── Runtime (scratch — ~7MB total) ──
|
|
FROM scratch
|
|
COPY --from=builder /build/dashboard /dashboard
|
|
EXPOSE 8080
|
|
CMD ["/dashboard"]
|