mirror of
https://github.com/luxfi/price.git
synced 2026-10-30 15:21:24 +00:00
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]>
24 lines
603 B
Docker
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"]
|