FROM golang:1.25-alpine AS build
WORKDIR /src
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 go build -o /out/ingest-service ./cmd/ingest-service

FROM alpine:3.20
RUN adduser -D -u 10001 app
COPY --from=build /out/ingest-service /usr/local/bin/ingest-service
USER app
ENTRYPOINT ["/usr/local/bin/ingest-service"]
