Skip to content

Commit f260afd

Browse files
committed
Fixes Prometheus config generation
Ensures the Prometheus configuration is always a file, not a directory, to prevent errors. Adds a dependency on the sources generator to ensure Prometheus starts after the configuration is ready.
1 parent 60b2158 commit f260afd

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

docker-compose.coolify.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ 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'
1923
"
2024
2125
# Target Database - The PostgreSQL database being monitored
@@ -70,6 +74,8 @@ services:
7074
- "--web.console.templates=/etc/prometheus/consoles"
7175
- "--storage.tsdb.retention.time=200h"
7276
- "--web.enable-lifecycle"
77+
depends_on:
78+
- sources-generator
7379

7480
# PGWatch Instance 1 - Monitoring service (Postgres sink)
7581
pgwatch-postgres:

0 commit comments

Comments
 (0)