chore: add Dockerfile with Go 1.25

Add multi-stage Dockerfile for building minimal container image
using golang:1.25-alpine base.
This commit is contained in:
Manuel Ganter 2026-02-04 14:19:47 +01:00
parent 219d26959f
commit 74ac653e58
No known key found for this signature in database

16
Dockerfile Normal file
View file

@ -0,0 +1,16 @@
FROM golang:1.25-alpine AS builder
WORKDIR /app
COPY go.mod ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /resource-collector ./cmd/collector
FROM alpine:3.19
COPY --from=builder /resource-collector /usr/local/bin/resource-collector
ENTRYPOINT ["/usr/local/bin/resource-collector"]