2024-01-10 14:18:00 +01:00
|
|
|
# syntax=docker/dockerfile:1
|
|
|
|
|
|
|
|
# Build the application from source
|
|
|
|
FROM golang:1.21.4 AS build-stage
|
|
|
|
|
|
|
|
WORKDIR /app
|
|
|
|
|
|
|
|
COPY go.mod go.sum ./
|
|
|
|
RUN go mod download
|
|
|
|
|
|
|
|
COPY *.go ./
|
|
|
|
|
|
|
|
RUN CGO_ENABLED=0 GOOS=linux go build -o /prometheus-jitsi-meet-exporter
|
|
|
|
|
|
|
|
# Run the tests in the container
|
|
|
|
FROM build-stage AS run-test-stage
|
|
|
|
RUN go test -v ./...
|
|
|
|
|
|
|
|
# Deploy the application binary into a lean image
|
|
|
|
FROM gcr.io/distroless/base-debian11 AS build-release-stage
|
|
|
|
|
|
|
|
WORKDIR /
|
|
|
|
|
|
|
|
COPY --from=build-stage /prometheus-jitsi-meet-exporter /prometheus-jitsi-meet-exporter
|
2020-03-21 20:53:50 +01:00
|
|
|
|
|
|
|
EXPOSE 9888
|
2021-03-12 11:15:13 +01:00
|
|
|
|
2024-01-10 14:18:00 +01:00
|
|
|
USER nonroot:nonroot
|
|
|
|
|
2020-03-21 20:53:50 +01:00
|
|
|
ENTRYPOINT ["/prometheus-jitsi-meet-exporter"]
|