feat: add stats helper service
Periodically snapshots Gitea instance metrics from a read-only MySQL user and writes stats.json into Gitea custom/public/assets for the home page to fetch same-origin. Config via env vars only. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
11
stats/Dockerfile
Normal file
11
stats/Dockerfile
Normal file
@@ -0,0 +1,11 @@
|
||||
# build
|
||||
FROM golang:1.23-alpine AS build
|
||||
WORKDIR /src
|
||||
COPY go.mod ./
|
||||
COPY main.go ./
|
||||
RUN go mod tidy && CGO_ENABLED=0 GOOS=linux go build -trimpath -ldflags "-s -w" -o /stats .
|
||||
|
||||
# runtime (minimal)
|
||||
FROM scratch
|
||||
COPY --from=build /stats /stats
|
||||
ENTRYPOINT ["/stats"]
|
||||
Reference in New Issue
Block a user