# BlueRune's Arch snapshot mirror (main.go), built where disco runs it.
FROM golang:1.25-alpine AS build
WORKDIR /src
COPY go.mod *.go ./
RUN go test ./... && CGO_ENABLED=0 go build -trimpath -ldflags=-s -o /arch-mirror .

FROM alpine:3.22
RUN apk add --no-cache ca-certificates
COPY --from=build /arch-mirror /usr/local/bin/arch-mirror
EXPOSE 8000
CMD ["/usr/local/bin/arch-mirror"]
