ARG GO_VERSION=1
FROM golang:${GO_VERSION}-bookworm as builder

WORKDIR /usr/src/app
COPY go.mod go.sum ./
RUN go mod download && go mod verify
COPY . .
RUN go build -v -o /run-app .


FROM debian:bookworm

RUN apt update
RUN apt install -y ca-certificates

WORKDIR /app

COPY public ./public
COPY regexes.yaml .
COPY --from=builder /run-app .

CMD ["./run-app"]
