The Go API on PostgreSQL ingests desktop, browser, presence, manual and Health Auto Export events and serves activities and daily goal summaries. The Hyprland agent records window focus, idle and lock intervals. The CI workflow publishes adam-french.co.uk/adamf/activity-tracker to the Gitea registry and rolls the web_server stack onto it. The image probes itself through a new `tracker healthcheck` command, because distroless has no wget. Co-Authored-By: Claude Opus 5.5 <[email protected]>
22 lines
879 B
Docker
22 lines
879 B
Docker
# Build from the repo root: docker build -f deploy/Dockerfile -t activity-tracker .
|
|
#
|
|
# Multi-arch by construction: both base images are published for arm64, and
|
|
# the Pi's CI (.gitea/workflows/ci.yaml) builds natively there. No
|
|
# `RUN --mount` cache lines, so it also builds on the Pi's legacy builder.
|
|
FROM golang:1.27 AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
RUN CGO_ENABLED=0 go build -trimpath -ldflags="-s -w" -o /out/tracker ./cmd/tracker
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
COPY --from=build /out/tracker /usr/local/bin/tracker
|
|
EXPOSE 8080
|
|
# distroless has no shell or wget, so the binary probes its own /readyz
|
|
# (process up and database reachable).
|
|
HEALTHCHECK --interval=30s --timeout=5s --start-period=10s --retries=3 \
|
|
CMD ["/usr/local/bin/tracker", "healthcheck"]
|
|
ENTRYPOINT ["/usr/local/bin/tracker"]
|
|
CMD ["serve"]
|