diff --git a/examples/docker-compose.yml b/examples/docker-compose.yml new file mode 100644 index 0000000..b0604bf --- /dev/null +++ b/examples/docker-compose.yml @@ -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: \ No newline at end of file diff --git a/examples/examples.md b/examples/examples.md new file mode 100644 index 0000000..e69de29 diff --git a/examples/prometheus.yml b/examples/prometheus.yml new file mode 100644 index 0000000..edae408 --- /dev/null +++ b/examples/prometheus.yml @@ -0,0 +1,5 @@ +scrape_configs: + - job_name: 'endlessh' + scrape_interval: 60s + static_configs: + - targets: ['endlessh:2112'] \ No newline at end of file