feat: add setup-prometheus target and update Prometheus service configuration

This commit is contained in:
2026-07-12 12:09:13 +08:00
parent b4263aa4b6
commit e48de7ddc0
3 changed files with 8 additions and 3 deletions
+7 -1
View File
@@ -238,7 +238,7 @@ deploy-grafana: pull setup-grafana
set +a ;\
docker stack deploy --compose-file ./swarm/grafana.yml grafana ;\
}
deploy-prometheus: pull
deploy-prometheus: pull setup-prometheus
{ \
echo "Deploying the prometheus stack..." ;\
set -a ;\
@@ -246,6 +246,12 @@ deploy-prometheus: pull
set +a ;\
docker stack deploy --compose-file ./swarm/prometheus.yml prometheus ;\
}
setup-prometheus:
{ \
echo "Setting up prometheus config on host..." ;\
mkdir -p /var/data/prometheus ;\
cp -n ./swarm/prometheus/prometheus.yml /var/data/prometheus/prometheus.yml 2>/dev/null || echo "prometheus.yml already exists, skipping" ;\
}
deploy-nodepad: pull
{ \
echo "Building the nodepad image..." ;\
-1
View File
@@ -19,7 +19,6 @@ services:
- /var/data/grafana/grafana.ini:/etc/grafana/grafana.ini:ro
- /var/data/grafana/provisioning:/etc/grafana/provisioning:ro
- /var/data/grafana/dashboards:/var/lib/grafana/dashboards:ro
- ./grafana/provisioning/datasources/prometheus.yml:/etc/grafana/provisioning/datasources/prometheus.yml:ro
networks:
- traefik-public
deploy:
+1 -1
View File
@@ -18,7 +18,7 @@ services:
volumes:
- prometheus_data:/prometheus
- /var/data/prometheus/rules:/etc/prometheus/rules:ro
- ./prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
- /var/data/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml:ro
networks:
- traefik-public
ports: