Skip to content

Commit

Permalink
Add docker
Browse files Browse the repository at this point in the history
  • Loading branch information
liuchengxu committed Aug 9, 2024
1 parent 919d84f commit 0c348cc
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 0 deletions.
33 changes: 33 additions & 0 deletions docker/grafana/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: 'subcoin'

services:
prometheus:
image: prom/prometheus:latest
container_name: prometheus
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus_data:/prometheus
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--web.listen-address=0.0.0.0:9090'
ports:
- '9090:9090' # Expose Prometheus UI on port 9090
restart: unless-stopped

grafana:
image: grafana/grafana:latest
container_name: grafana
ports:
- '3000:3000' # Expose Grafana UI on port 3000
environment:
- GF_SECURITY_ADMIN_USER=admin
- GF_SECURITY_ADMIN_PASSWORD=admin
volumes:
- grafana_data:/var/lib/grafana
depends_on:
- prometheus
restart: unless-stopped

volumes:
prometheus_data:
grafana_data:
9 changes: 9 additions & 0 deletions docker/grafana/prometheus.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# A scrape configuration containing exactly one endpoint to scrape:
scrape_configs:
- job_name: "subcoin_node"

scrape_interval: 5s

static_configs:
# Replace localhost as the public IP address if deployed on the cloud.
- targets: ["localhost:9615"]

0 comments on commit 0c348cc

Please sign in to comment.