chore: use auth file instead of env on prometheus

This commit is contained in:
2026-03-13 09:59:32 +01:00
parent 38ec518695
commit 63fc35c62c
2 changed files with 4 additions and 5 deletions

View File

@@ -75,13 +75,12 @@ services:
image: 'prom/prometheus:v3.4.2'
command:
- '--config.file=/etc/prometheus/prometheus.yml'
- '--config.expand-env'
- '--storage.tsdb.path=/prometheus'
- '--web.enable-lifecycle'
env_file:
- .env
volumes:
- './observability/prometheus.yml:/etc/prometheus/prometheus.yml:ro'
- './observability/web_username:/etc/prometheus/web_username'
- './observability/web_password:/etc/prometheus/web_password'
- 'hctv_prometheus_data:/prometheus'
extra_hosts:
- 'host.docker.internal:host-gateway'

View File

@@ -6,8 +6,8 @@ scrape_configs:
- job_name: web
metrics_path: /api/metrics
basic_auth:
username: ${METRICS_USER}
password: ${METRICS_PASS}
username: /etc/prometheus/web_username
password: /etc/prometheus/web_password
static_configs:
- targets:
- hctv:3000