👌 IMPROVE: Update Loki service configuration to expand environment variables and fix healthcheck URL

This commit is contained in:
2025-05-19 11:13:31 +00:00
parent cab9ccf1af
commit 011aa2d613

View File

@@ -65,7 +65,11 @@ services:
loki: loki:
container_name: loki container_name: loki
image: docker.io/grafana/loki:3.5.0 image: docker.io/grafana/loki:3.5.0
command: "-config.file=/etc/loki/config.yaml" # Tells Grafana Loki to start with the config file. command:
- "-config.file=/etc/loki/config.yaml" # Tells Grafana Loki to start with the config file.
- "-config.expand-env=true"
ports:
- "3100:3100"
volumes: volumes:
- ./config/loki-config.yaml:/etc/loki/config.yaml:ro - ./config/loki-config.yaml:/etc/loki/config.yaml:ro
- data_loki:/loki:rw - data_loki:/loki:rw
@@ -73,7 +77,7 @@ services:
- grafana-prometheus - grafana-prometheus
restart: unless-stopped restart: unless-stopped
healthcheck: healthcheck:
test: ["CMD", "wget", "--spider", "-q", "http://localhost:3100/ready"] test: ["CMD", "wget", "--spider", "-q", "http://loki:3100/ready"]
interval: 10s # check every 10 seconds interval: 10s # check every 10 seconds
timeout: 5s # wait max 5 seconds per check timeout: 5s # wait max 5 seconds per check
retries: 5 # mark as unhealthy after 5 failures retries: 5 # mark as unhealthy after 5 failures
@@ -81,7 +85,7 @@ services:
https_portal: https_portal:
container_name: https_portal container_name: https_portal
image: "steveltn/https-portal:1.21" image: "steveltn/https-portal:1.21"
restart: unless-stopped restart: always
networks: networks:
- grafana-prometheus - grafana-prometheus
ports: ports:
@@ -95,6 +99,7 @@ services:
CLIENT_MAX_BODY_SIZE: 0 CLIENT_MAX_BODY_SIZE: 0
# FORCE_RENEW: 'true' # FORCE_RENEW: 'true'
DOMAINS: 'grafana.phx-erp.de -> https://grafana:3000, prometheus.phx-erp.de -> https://prometheus:9090' DOMAINS: 'grafana.phx-erp.de -> https://grafana:3000, prometheus.phx-erp.de -> https://prometheus:9090'
# loki-logs.phx-erp.de -> http://localhost:3100
volumes: volumes:
- ./https_portal/data:/var/lib/https-portal # ssl_certs, vhost.d, htdocs - ./https_portal/data:/var/lib/https-portal # ssl_certs, vhost.d, htdocs
- ./https_portal/log:/var/log/nginx # nginx logs - ./https_portal/log:/var/log/nginx # nginx logs