2024-04-17 19:38:21 +02:00
|
|
|
FROM golang:1.22-bullseye AS dev
|
2024-04-17 15:34:23 +02:00
|
|
|
|
|
|
|
COPY . /var/app
|
|
|
|
WORKDIR /var/app
|
|
|
|
|
2024-04-17 19:38:21 +02:00
|
|
|
|
2024-04-17 15:34:23 +02:00
|
|
|
ENV GO111MODULE="on" \
|
|
|
|
CGO_ENABLED=0 \
|
|
|
|
GOOS=linux
|
|
|
|
|
|
|
|
EXPOSE 80
|
|
|
|
ENTRYPOINT ["sh"]
|
|
|
|
|
|
|
|
|
|
|
|
FROM dev as build
|
|
|
|
|
2024-04-17 19:38:21 +02:00
|
|
|
RUN DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends --assume-yes ca-certificates
|
2024-04-17 15:34:23 +02:00
|
|
|
RUN go mod download && go mod verify
|
2024-04-17 19:38:21 +02:00
|
|
|
RUN go build -o ntppool-exporter main.go
|
2024-04-17 15:34:23 +02:00
|
|
|
RUN chmod +x ntppool-exporter
|
|
|
|
|
|
|
|
|
2024-04-17 19:38:21 +02:00
|
|
|
FROM debian:12 AS prod
|
2024-04-17 15:34:23 +02:00
|
|
|
|
|
|
|
WORKDIR /app
|
2024-04-17 19:38:21 +02:00
|
|
|
COPY --from=build /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/
|
2024-04-17 15:34:23 +02:00
|
|
|
COPY --from=build /var/app/ntppool-exporter /bin/
|
|
|
|
|
|
|
|
LABEL maintainer="Adora Laura Kalb <adora@lila.network>"
|
|
|
|
|
|
|
|
EXPOSE 43609
|
|
|
|
ENTRYPOINT ["/bin/ntppool-exporter"]
|