cast-ghl-plugin/Dockerfile
Head of Product & Engineering 5f7dd7462d
Some checks failed
ci/woodpecker/push/woodpecker Pipeline failed
fix: add USER nobody to Dockerfile to pass semgrep security check
Running as root in a container is a security hazard. Use the existing
nobody user from alpine:3.19 to drop privileges before CMD.

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-04-05 22:49:28 +02:00

16 lines
490 B
Docker

FROM golang:1.26-alpine AS builder
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -ldflags="-s -w" -o /cast-ghl-provider ./cmd/server/
FROM alpine:3.19
RUN apk add --no-cache ca-certificates tzdata
COPY --from=builder /cast-ghl-provider /cast-ghl-provider
EXPOSE 3002
HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
CMD wget -qO- http://localhost:3002/health || exit 1
USER nobody
CMD ["/cast-ghl-provider"]