FROM golang:1.23-alpine AS builder
RUN apk add --no-cache git
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o /bridge-monitor ./cmd/monitor

FROM alpine:3.20
RUN apk add --no-cache ca-certificates
COPY --from=builder /bridge-monitor /usr/local/bin/bridge-monitor
EXPOSE 3024
CMD ["bridge-monitor"]
