diff --git a/Dockerfile b/Dockerfile index bd4bb9e..b6d1431 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,6 +24,14 @@ RUN case "$(uname -m)" in \ && tar -xjvf monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 --strip-components 1 \ && rm -f monero-linux-${ARCH}-${MONERO_VERSION}.tar.bz2 + +################## +# -- exporter -- # +################## +FROM docker.io/golang:1.19 AS exporter + +RUN GO111MODULE=on go install github.com/cirocosta/monero-exporter/cmd/monero-exporter@master + ################## # --- runner --- # ################## @@ -44,10 +52,12 @@ RUN apt-get update && \ chown -R monero:monero /opt/bitmonero COPY --from=builder /opt/monero/* /opt/monero/ +COPY --from=exporter /go/bin/monero-exporter /opt/monero/monero-exporter +COPY ./entrypoint.sh /entrypoint.sh USER monero WORKDIR /home/monero VOLUME /opt/bitmonero EXPOSE 18080 18081 -ENTRYPOINT ["tini", "--" ,"/opt/monero/monerod"] +ENTRYPOINT ["tini", "--", "/entrypoint.sh"] diff --git a/entrypoint.sh b/entrypoint.sh new file mode 100755 index 0000000..71c8aa2 --- /dev/null +++ b/entrypoint.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +/opt/monero/monero-exporter \ + --bind-addr "${EXPORTER_BIND:-":9000"}" \ + --monero-addr "http://127.0.0.1:18081" \ + --telemetry-path "${EXPORTER_PATH:-"/metrics"}" & + +/opt/monero/monerod "$@" +