FROM golang:1.23.0 as build

LABEL author="vlbeaudoin"

WORKDIR /go/src/app

COPY go.mod go.sum LICENSE ./

ADD cmd/ cmd/
ADD pkg/ pkg/
ADD queries/ queries/
ADD templates/ templates/

RUN CGO_ENABLED=0 go build -a -o bottin ./cmd/bottin

# Alpine

FROM alpine:3.20.2

WORKDIR /app

COPY --from=build /go/src/app/bottin /usr/bin/bottin

CMD ["bottin", "--help"]