add example docker compose

This commit is contained in:
Shizun Ge
2021-10-27 23:52:20 -07:00
parent daf09ba161
commit 60ce18914d
3 changed files with 66 additions and 0 deletions

View File

@@ -0,0 +1,61 @@
version: '3.5'
services:
endlessh:
container_name: endlessh
image: shizunge/endlessh-go:latest
restart: always
command:
- -interval_ms=1000
- -logtostderr
- -v=1
- -enable_prometheus
- -geoip_supplier=ip-api
networks:
- example_network
ports:
# SSH port
- 2222:2222
# Prometheus metrics port
- 2112:2112
prometheus:
image: prom/prometheus:latest
container_name: prometheus
restart: always
command:
- --config.file=/etc/prometheus/prometheus.yml
- --storage.tsdb.path=/prometheus
- --storage.tsdb.retention.time=45d
- --web.console.libraries=/usr/share/prometheus/console_libraries
- --web.console.templates=/usr/share/prometheus/consoles
- --web.enable-admin-api
networks:
- example_network
ports:
- 9090:9090
volumes:
- ./prometheus.yml:/etc/prometheus/prometheus.yml
- prometheus:/prometheus
grafana:
image: grafana/grafana:latest
container_name: grafana
restart: always
networks:
- example_network
ports:
- 3000:3000
environment:
- GF_SECURITY_ADMIN_USER=examples
- GF_SECURITY_ADMIN_PASSWORD=examples
volumes:
- grafana_var:/var/lib/grafana/
- grafana_etc:/etc/grafana/
networks:
example_network:
volumes:
prometheus:
grafana_var:
grafana_etc:

0
examples/examples.md Normal file
View File

5
examples/prometheus.yml Normal file
View File

@@ -0,0 +1,5 @@
scrape_configs:
- job_name: 'endlessh'
scrape_interval: 60s
static_configs:
- targets: ['endlessh:2112']