FROM golang:1.22.3 as build
LABEL author="vlbeaudoin"
WORKDIR /go/src/app
COPY go.mod go.sum db.go entity.go main.go responses.go ./
ADD cmd/ cmd/
ADD templates/ templates/
ADD sql/ sql/
RUN CGO_ENABLED=0 go build -a -o bottin .
# Alpine
FROM alpine:3.20
WORKDIR /app
COPY --from=build /go/src/app/bottin /usr/bin/bottin
CMD ["bottin", "--help"]