Skip to content

Commit 2a2ae8b

Browse files
authored
Feat/create dockerfile (#5)
* Create dockerfile for containerization support * CI - ignore .github/workflows and Dockerfile
1 parent 2cfab2f commit 2a2ae8b

2 files changed

Lines changed: 31 additions & 1 deletion

File tree

.github/workflows/rust-ci.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,15 @@ on:
66
- '*'
77
- '!main'
88
paths-ignore:
9+
- .github/workflows
910
- '**/*.md'
11+
- Dockerfile
1012
pull_request:
1113
branches: [ "*" ]
14+
paths-ignore:
15+
- .github/workflows
16+
- '**/*.md'
17+
- Dockerfile
1218
workflow_dispatch:
1319

1420
env:
@@ -20,7 +26,7 @@ jobs:
2026
runs-on: ubuntu-latest
2127

2228
steps:
23-
- uses: actions/checkout@v4
29+
- uses: actions/checkout@v6
2430
- name: Build
2531
run: cargo build --verbose
2632
- name: Run tests

Dockerfile

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
FROM rust:bookworm AS build
2+
3+
# Dependencies
4+
RUN USER=root apt-get update && apt-get upgrade -y
5+
6+
# Install the lastest version directly into path
7+
RUN cargo install btcnode-metrics --root /usr/local
8+
9+
#####
10+
# Final base
11+
FROM debian:bookworm-slim
12+
13+
COPY --from=build /usr/local/bin/btcnode-metrics /usr/local/bin/btcnode-metrics
14+
15+
# copy the bin and config
16+
RUN mkdir /etc/btcnode-metrics
17+
COPY ./config.local.toml /etc/btcnode-metrics/config.toml
18+
19+
# expose the port identified in the config
20+
EXPOSE 9898
21+
22+
ENV RUST_LOG=info
23+
24+
CMD ["/usr/local/bin/btcnode-metrics", "-c", "/etc/btcnode-metrics/config.toml"]

0 commit comments

Comments
 (0)