Files
fit/Dockerfile
scott 3168a4ef96
Some checks failed
Build and Deploy / build-and-deploy (push) Failing after 2m44s
Rename the app from tracker to fit
The directory, the repo and the hostname are all fit; the module path,
the image, the namespace and the data file were still tracker. Nothing
is deployed yet, so this is free now and would not be later.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-08-01 22:03:33 -07:00

29 lines
667 B
Docker

FROM golang:1.26-alpine AS build
WORKDIR /src
# Dependencies first, so edits to the app don't re-download the module cache.
# There are none, but the layer keeps the shape of the other apps.
COPY go.mod ./
RUN go mod download
COPY . .
# Static binary: no libc, so it runs in a scratch image. The timezone database
# is embedded by the `time/tzdata` import in main.go.
RUN CGO_ENABLED=0 GOOS=linux go build \
-trimpath \
-ldflags="-s -w" \
-o /out/fit ./cmd/server
FROM scratch
COPY --from=build /out/fit /fit
# nobody:nogroup — the only writable path is the mounted volume at /data.
USER 65534:65534
EXPOSE 8080
ENTRYPOINT ["/fit"]