Skip to content

Commit c575152

Browse files
committed
Configures Prometheus with bind mounts
Updates Prometheus to use bind mounts for configuration. This simplifies configuration management and makes it consistent with other services. Adds grafana ini to provisioning folder
1 parent 770ccc1 commit c575152

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

docker-compose.coolify.yml

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,6 @@ services:
1616
echo '' >> /app/config/pgwatch-prometheus/sources.yml &&
1717
sed 's/~sink_type~/prometheus/g' /app/instances.yaml >> /app/config/pgwatch-prometheus/sources.yml &&
1818
echo 'Generated sources.yml files for both postgres and prometheus'
19-
20-
# --- PROMETHEUS CONFIG: always ensure it's a FILE, not a dir ---
21-
rm -rf /app/config/prometheus/prometheus.yml &&
22-
cat > /app/config/prometheus/prometheus.yml <<'YAML'
2319
"
2420
2521
# Target Database - The PostgreSQL database being monitored
@@ -61,11 +57,13 @@ services:
6157
# Prometheus Sink - Storage for metrics in Prometheus format
6258
sink-prometheus:
6359
image: prom/prometheus:v3.4.2
64-
container_name: sink-prometheus
6560
ports:
6661
- "59090:9090"
6762
volumes:
68-
- ./config/prometheus:/etc/prometheus
63+
- type: bind
64+
source: ./config/prometheus/prometheus.yml
65+
target: /etc/prometheus/prometheus.yml
66+
read_only: true
6967
- prometheus_data:/prometheus
7068
command:
7169
- "--config.file=/etc/prometheus/prometheus.yml"
@@ -74,8 +72,6 @@ services:
7472
- "--web.console.templates=/etc/prometheus/consoles"
7573
- "--storage.tsdb.retention.time=200h"
7674
- "--web.enable-lifecycle"
77-
depends_on:
78-
- sources-generator
7975

8076
# PGWatch Instance 1 - Monitoring service (Postgres sink)
8177
pgwatch-postgres:
@@ -132,6 +128,7 @@ services:
132128
- grafana_data:/var/lib/grafana
133129
- ./config/grafana/provisioning:/etc/grafana/provisioning
134130
- ./config/grafana/dashboards:/var/lib/grafana/dashboards
131+
- ./config/grafana/provisioning/grafana.ini:/etc/grafana/grafana.ini
135132
depends_on:
136133
- sink-postgres
137134
- sink-prometheus

0 commit comments

Comments
 (0)