diff --git a/.github/workflows/rust-ci.yml b/.github/workflows/rust-ci.yml index d6df033..db10e27 100644 --- a/.github/workflows/rust-ci.yml +++ b/.github/workflows/rust-ci.yml @@ -6,9 +6,15 @@ on: - '*' - '!main' paths-ignore: + - .github/workflows - '**/*.md' + - Dockerfile pull_request: branches: [ "*" ] + paths-ignore: + - .github/workflows + - '**/*.md' + - Dockerfile workflow_dispatch: env: @@ -20,7 +26,7 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Build run: cargo build --verbose - name: Run tests diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0587583 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,24 @@ +FROM rust:bookworm AS build + +# Dependencies +RUN USER=root apt-get update && apt-get upgrade -y + +# Install the lastest version directly into path +RUN cargo install btcnode-metrics --root /usr/local + +##### +# Final base +FROM debian:bookworm-slim + +COPY --from=build /usr/local/bin/btcnode-metrics /usr/local/bin/btcnode-metrics + +# copy the bin and config +RUN mkdir /etc/btcnode-metrics +COPY ./config.local.toml /etc/btcnode-metrics/config.toml + +# expose the port identified in the config +EXPOSE 9898 + +ENV RUST_LOG=info + +CMD ["/usr/local/bin/btcnode-metrics", "-c", "/etc/btcnode-metrics/config.toml"] \ No newline at end of file