FROM golang:1.25 AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -o jiralert ./cmd/jiralert

FROM alpine:latest
RUN apk --no-cache add ca-certificates tzdata
WORKDIR /app
COPY --from=builder /app/jiralert /app/jiralert
COPY config/ /app/config/
EXPOSE 8080
ENTRYPOINT ["/app/jiralert"]
