FROM golang:1.22-alpine AS build
WORKDIR /src
COPY go.mod go.sum* ./
RUN go mod download
COPY main.go ./
RUN CGO_ENABLED=0 go build -o /cluster-map .

FROM alpine:3.20
RUN adduser -D -u 10001 app
COPY --from=build /cluster-map /cluster-map
COPY static /static
USER app
WORKDIR /
ENTRYPOINT ["/cluster-map"]
