127 lines
3.4 KiB
YAML
127 lines
3.4 KiB
YAML
services:
|
|
loki:
|
|
image: grafana/loki:${LOKI_VERSION:-3.7.2}
|
|
container_name: monitor-loki
|
|
volumes:
|
|
- ${MONITOR_STACK_CONFIG_PATH}/loki-config.yml:/etc/loki/local-config.yaml
|
|
- loki_data:/loki
|
|
command: -config.file=/etc/loki/local-config.yaml
|
|
environment:
|
|
- TZ=${TZ:-America/Los_Angeles}
|
|
networks:
|
|
- monitor_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3100/ready || exit 1"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512m
|
|
restart: unless-stopped
|
|
|
|
prometheus:
|
|
image: prom/prometheus:${PROMETHEUS_VERSION:-3.12.0}
|
|
container_name: prometheus
|
|
ports:
|
|
- "${PROMETHEUS_PORT:-9090}:9090"
|
|
volumes:
|
|
- ${MONITOR_STACK_CONFIG_PATH}/prometheus.yml:/etc/prometheus/prometheus.yml
|
|
- prometheus_data:/prometheus
|
|
command:
|
|
- '--config.file=/etc/prometheus/prometheus.yml'
|
|
- '--storage.tsdb.path=/prometheus'
|
|
- '--storage.tsdb.retention.time=30d'
|
|
- '--web.enable-lifecycle'
|
|
environment:
|
|
- TZ=${TZ:-America/Los_Angeles}
|
|
networks:
|
|
- monitor_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:9090/-/healthy || exit 1"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512m
|
|
restart: unless-stopped
|
|
|
|
alertmanager:
|
|
image: prom/alertmanager:${ALERTMANAGER_VERSION:-0.32.1}
|
|
container_name: alertmanager
|
|
ports:
|
|
- "${ALERTMANAGER_PORT:-9093}:9093"
|
|
volumes:
|
|
- ${MONITOR_STACK_CONFIG_PATH}/alertmanager.yml:/etc/alertmanager/alertmanager.yml
|
|
- alertmanager_data:/alertmanager
|
|
command:
|
|
- '--config.file=/etc/alertmanager/alertmanager.yml'
|
|
- '--storage.path=/alertmanager'
|
|
environment:
|
|
- TZ=${TZ:-America/Los_Angeles}
|
|
networks:
|
|
- monitor_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:9093/-/healthy || exit 1"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512m
|
|
restart: unless-stopped
|
|
|
|
grafana:
|
|
image: grafana/grafana:${GRAFANA_VERSION:-13.0.1}
|
|
container_name: grafana
|
|
ports:
|
|
- "${GRAFANA_PORT:-3000}:3000"
|
|
volumes:
|
|
- grafana_data:/var/lib/grafana
|
|
environment:
|
|
- TZ=${TZ:-America/Los_Angeles}
|
|
- GF_SECURITY_ADMIN_USER=${GRAFANA_ADMIN_USER:-admin}
|
|
- GF_SECURITY_ADMIN_PASSWORD=${GRAFANA_ADMIN_PASSWORD:-changeme}
|
|
- GF_SECURITY_SECRET_KEY=${GRAFANA_SECRET_KEY}
|
|
- GF_LOG_MODE=console
|
|
depends_on:
|
|
loki:
|
|
condition: service_healthy
|
|
prometheus:
|
|
condition: service_healthy
|
|
alertmanager:
|
|
condition: service_healthy
|
|
networks:
|
|
- monitor_network
|
|
healthcheck:
|
|
test: ["CMD-SHELL", "wget --no-verbose --tries=1 --spider http://localhost:3000/api/health || exit 1"]
|
|
interval: 15s
|
|
timeout: 5s
|
|
retries: 5
|
|
start_period: 30s
|
|
deploy:
|
|
resources:
|
|
limits:
|
|
memory: 512m
|
|
restart: unless-stopped
|
|
|
|
volumes:
|
|
loki_data:
|
|
name: loki_data
|
|
prometheus_data:
|
|
name: prometheus_data
|
|
alertmanager_data:
|
|
name: alertmanager_data
|
|
grafana_data:
|
|
name: grafana_data
|
|
|
|
networks:
|
|
monitor_network:
|
|
external: true |