d45111645c
- REST API for calculating age breakdowns (years, months, weeks, days, hours, minutes, seconds)
- Birthtime configured as Unix timestamps
- Sleeps until next birthday countdown
- Per-person lookup via GET /age/{name}
- Docker and Makefile build support
- Woodpecker CI pipelines
24 lines
440 B
Docker
24 lines
440 B
Docker
FROM golang:1.25-alpine AS builder
|
|
|
|
RUN apk add --no-cache git
|
|
|
|
WORKDIR /build
|
|
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
COPY . .
|
|
|
|
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o age-api .
|
|
|
|
FROM gcr.io/distroless/static-debian12:nonroot
|
|
|
|
COPY --from=builder /build/age-api /usr/local/bin/age-api
|
|
COPY --from=builder /build/config.yaml /etc/age-api/config.yaml
|
|
|
|
ENV CONFIG_PATH=/etc/age-api/config.yaml
|
|
|
|
EXPOSE 8080
|
|
|
|
ENTRYPOINT ["age-api"]
|