FROM golang:1.22-alpine3.18@sha256:790c66717f8c02bb36f468f2fa68fa2b41c25e7612edbe5b0192ddf20944a21e AS builder
WORKDIR /corn-util
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN go build -trimpath ./
FROM alpine:latest@sha256:c5b1261d6d3e43071626931fc004f70149baeba2c8ec672bd4f27761f8e1ad6b
WORKDIR /home/corn-util
COPY --from=builder /corn-util/bot ./
EXPOSE 23242
CMD ["./bot"]