add hetzner server infrastructure files
This commit is contained in:
@@ -0,0 +1,93 @@
|
||||
services:
|
||||
# --- ЯДРО: Caddy с авто-лейблами ---
|
||||
caddy:
|
||||
image: lucaslorentz/caddy-docker-proxy:latest
|
||||
container_name: caddy
|
||||
ports:
|
||||
- 80:80
|
||||
- 443:443
|
||||
environment:
|
||||
- CADDY_INGRESS_NETWORKS=jambotron-net
|
||||
networks:
|
||||
- jambotron-net
|
||||
volumes:
|
||||
- /var/run/docker.sock:/var/run/docker.sock:ro
|
||||
- caddy_data:/data
|
||||
restart: always
|
||||
|
||||
# --- МОНИТОРИНГ: Prometheus ---
|
||||
prometheus:
|
||||
image: prom/prometheus:latest
|
||||
container_name: prometheus
|
||||
volumes:
|
||||
- ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
|
||||
- prometheus_data:/prometheus
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
# --- МОНИТОРИНГ: Grafana ---
|
||||
grafana:
|
||||
image: grafana/grafana:latest
|
||||
container_name: grafana
|
||||
networks:
|
||||
- jambotron-net
|
||||
environment:
|
||||
- GF_SECURITY_ADMIN_PASSWORD=monitorPWD
|
||||
- GF_SERVER_ROOT_URL=%(protocol)s://%(domain)s:%(http_port)s/monitor/
|
||||
- GF_SERVER_SERVE_FROM_SUB_PATH=true
|
||||
labels:
|
||||
caddy: jambotron.com
|
||||
caddy.handle: /monitor/*
|
||||
caddy.handle.reverse_proxy: "{{upstreams 3000}}"
|
||||
volumes:
|
||||
- grafana_data:/var/lib/grafana
|
||||
restart: always
|
||||
|
||||
# --- ДАТЧИКИ ---
|
||||
node-exporter:
|
||||
image: prom/node-exporter:latest
|
||||
container_name: node-exporter
|
||||
volumes:
|
||||
- /proc:/host/proc:ro
|
||||
- /sys:/host/sys:ro
|
||||
- /:/rootfs:ro
|
||||
command:
|
||||
- '--path.procfs=/host/proc'
|
||||
- '--path.sysfs=/host/sys'
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
cadvisor:
|
||||
image: gcr.io/cadvisor/cadvisor:latest
|
||||
container_name: cadvisor
|
||||
volumes:
|
||||
- /:/rootfs:ro
|
||||
- /var/run:/var/run:ro
|
||||
- /sys:/sys:ro
|
||||
- /var/lib/docker/:/var/lib/docker:ro
|
||||
- /dev/disk/:/dev/disk:ro
|
||||
networks:
|
||||
- jambotron-net
|
||||
restart: always
|
||||
|
||||
# --- ТЕСТОВЫЙ ПОДДОМЕН (Wildcard DNS должен быть включен) ---
|
||||
test-app1:
|
||||
image: traefik/whoami
|
||||
container_name: test-app1
|
||||
networks:
|
||||
- jambotron-net
|
||||
labels:
|
||||
caddy: test-app1.jambotron.com
|
||||
caddy.reverse_proxy: "{{upstreams 80}}"
|
||||
restart: always
|
||||
|
||||
networks:
|
||||
jambotron-net:
|
||||
name: jambotron-net
|
||||
|
||||
volumes:
|
||||
caddy_data:
|
||||
prometheus_data:
|
||||
grafana_data:
|
||||
@@ -0,0 +1,11 @@
|
||||
global:
|
||||
scrape_interval: 15s
|
||||
|
||||
scrape_configs:
|
||||
- job_name: 'node'
|
||||
static_configs:
|
||||
- targets: ['node-exporter:9100']
|
||||
|
||||
- job_name: 'cadvisor'
|
||||
static_configs:
|
||||
- targets: ['cadvisor:8080']
|
||||
Reference in New Issue
Block a user