The site and its runner moved from the arm64 Pi (stppi) to stpvm (x86-64), so the clone URL and the comments about the build host and image architecture were wrong. Co-Authored-By: Claude Opus 5.5 <[email protected]>
32 lines
1.1 KiB
Docker
32 lines
1.1 KiB
Docker
# Build from the repo root: docker build -f deploy/Dockerfile -t activity-tracker .
|
|
#
|
|
# Multi-arch by construction: all the base images are published for amd64 and
|
|
# arm64, and CI (.gitea/workflows/ci.yaml) builds natively on whichever host
|
|
# runs it. No `RUN --mount` cache lines, so it also builds on Docker's legacy
|
|
# builder.
|
|
FROM node:24-alpine AS web
|
|
WORKDIR /src/web
|
|
COPY web/package.json web/package-lock.json ./
|
|
RUN npm ci
|
|
COPY web/ ./
|
|
# Writes ../internal/web/dist/app, which the Go build embeds.
|
|
RUN npm run build
|
|
|
|
FROM golang:1.27 AS build
|
|
WORKDIR /src
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
COPY . .
|
|
COPY --from=web /src/internal/web/dist/app internal/web/dist/app
|
|
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"]
|