- Switch OnMessage → OnTypedMessage with natsutil.Decode[messages.PipelineTrigger] - Return *messages.PipelineStatus (not map[string]any) - Remove strVal/mapVal helpers - Add .dockerignore, GOAMD64=v3 in Dockerfile - Update tests for typed structs (14 tests pass)
32 lines
643 B
Docker
32 lines
643 B
Docker
# Build stage
|
|
FROM golang:1.25-alpine AS builder
|
|
|
|
WORKDIR /app
|
|
|
|
# Install ca-certificates for HTTPS
|
|
RUN apk add --no-cache ca-certificates
|
|
|
|
# Copy go mod files
|
|
COPY go.mod go.sum ./
|
|
RUN go mod download
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build static binary
|
|
RUN CGO_ENABLED=0 GOOS=linux GOAMD64=v3 go build -ldflags="-w -s" -o /pipeline-bridge .
|
|
|
|
# Runtime stage - scratch for minimal image
|
|
FROM scratch
|
|
|
|
# Copy CA certificates for HTTPS
|
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
|
|
|
# Copy binary
|
|
COPY --from=builder /pipeline-bridge /pipeline-bridge
|
|
|
|
# Run as non-root
|
|
USER 65534:65534
|
|
|
|
ENTRYPOINT ["/pipeline-bridge"]
|