Files
zeekayandHanzo Dev 3e81f2ebaa Go 1.27.1, and the code it can say more simply
Modules declare go 1.27.1 and the build images follow. go fix applied the
modernizers; omitzero is not applied, since it changes what the JSON says.

Co-authored-by: Hanzo Dev <[email protected]>
2026-09-16 18:47:53 -07:00

24 lines
603 B
Docker

FROM golang:1.27.1-alpine AS builder
ENV GOTOOLCHAIN=auto
WORKDIR /app
# The whole tree, not `go.mod` + `*.go`. That pair silently excluded pkg/, which
# builds today only because main.go does not import it yet — the first import
# would break the image build with an error that reads like a module problem.
# .dockerignore already keeps .git, docs and *_test.go out.
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o price .
FROM alpine:3.19
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/price .
ENV PORT=8080
EXPOSE 8080
CMD ["./price"]