Skip to content

Commit 3b58bc7

Browse files
committed
Dockerise
1 parent b8ea194 commit 3b58bc7

File tree

3 files changed

+56
-0
lines changed

3 files changed

+56
-0
lines changed

Dockerfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM rust:1.86 AS builder
2+
WORKDIR /usr/src/app
3+
COPY . .
4+
RUN cargo build --release
5+
6+
FROM debian:bullseye-slim
7+
RUN apt-get update && apt-get install -y ca-certificates && rm -rf /var/lib/apt/lists/*
8+
WORKDIR /usr/local/bin
9+
COPY --from=builder /usr/src/app/target/release/blocktop .
10+
EXPOSE 9898
11+
ENTRYPOINT ["blocktop"]

docker-compose.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
services:
2+
blocktop:
3+
build: .
4+
command: ["blocktop", "--headless", "--metrics"]
5+
environment:
6+
- RUST_LOG=info
7+
ports:
8+
- "9898:9898"
9+
networks:
10+
- monitoring
11+
12+
prometheus:
13+
image: prom/prometheus:latest
14+
volumes:
15+
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
16+
ports:
17+
- "9090:9090"
18+
networks:
19+
- monitoring
20+
21+
grafana:
22+
image: grafana/grafana:latest
23+
ports:
24+
- "3000:3000"
25+
volumes:
26+
- grafana-data:/var/lib/grafana
27+
environment:
28+
- GF_AUTH_ANONYMOUS_ENABLED=true
29+
networks:
30+
- monitoring
31+
32+
volumes:
33+
grafana-data:
34+
35+
networks:
36+
monitoring:
37+
driver: bridge

prometheus.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
global:
2+
scrape_interval: 30s
3+
scrape_configs:
4+
- job_name: 'blocktop'
5+
metrics_path: /metrics
6+
static_configs:
7+
- targets: ['blocktop:9898']
8+

0 commit comments

Comments
 (0)