Skip to content

Commit

Permalink
Monero Exporter
Browse files Browse the repository at this point in the history
  • Loading branch information
rblaine95 committed Mar 12, 2024
1 parent 46584c5 commit a227531
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,13 @@ 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.22 AS exporter

RUN GO111MODULE=on go install github.com/cirocosta/monero-exporter/cmd/monero-exporter@master

##################
# --- runner --- #
##################
Expand All @@ -44,10 +51,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"]
11 changes: 11 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/bin/bash

if [ "${EXPORTER_ENABLED:-"true"}" = "true" ]; then
/opt/monero/monero-exporter \
--bind-addr "${EXPORTER_BIND:-":9000"}" \
--monero-addr "http://127.0.0.1:18081" \
--telemetry-path "${EXPORTER_PATH:-"/metrics"}" &
fi

/opt/monero/monerod "$@"

0 comments on commit a227531

Please sign in to comment.