Skip to content

Commit 9973af5

Browse files
Added prefix for the ports and fixed autolaunch
1 parent 7bf8478 commit 9973af5

File tree

2 files changed

+13
-13
lines changed

2 files changed

+13
-13
lines changed

docker-compose.yml

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ services:
2828
POSTGRES_PASSWORD: postgres
2929
command: ["postgres", "-c", "shared_preload_libraries=pg_stat_statements", "-c", "pg_stat_statements.track=all"]
3030
ports:
31-
- "5432:5432"
31+
- "55432:5432"
3232
volumes:
3333
- target_db_data:/var/lib/postgresql/data
3434
- ./config/target-db/init.sql:/docker-entrypoint-initdb.d/init.sql
@@ -42,7 +42,7 @@ services:
4242
POSTGRES_USER: postgres
4343
POSTGRES_PASSWORD: postgres
4444
ports:
45-
- "5433:5432"
45+
- "55433:5432"
4646
volumes:
4747
- sink_postgres_data:/var/lib/postgresql/data
4848
- ./config/sink-postgres/init.sql:/docker-entrypoint-initdb.d/init.sql
@@ -52,7 +52,7 @@ services:
5252
image: prom/prometheus:v3.4.2
5353
container_name: sink-prometheus
5454
ports:
55-
- "9090:9090"
55+
- "59090:9090"
5656
volumes:
5757
- ./config/prometheus/prometheus.yml:/etc/prometheus/prometheus.yml
5858
- prometheus_data:/prometheus
@@ -70,7 +70,7 @@ services:
7070
container_name: pgwatch-postgres
7171
command: ["--sources=/etc/pgwatch/sources.yml", "--metrics=/etc/pgwatch/metrics.yml", "--sink=postgresql://pgwatch:pgwatchadmin@sink-postgres:5432/measurements", "--web-addr=:8080"]
7272
ports:
73-
- "8080:8080"
73+
- "58080:8080"
7474
depends_on:
7575
- sources-generator
7676
- sink-postgres
@@ -84,8 +84,8 @@ services:
8484
container_name: pgwatch-prometheus
8585
command: ["--sources=/etc/pgwatch/sources.yml", "--metrics=/etc/pgwatch/metrics.yml", "--sink=prometheus://0.0.0.0:9091/pgwatch", "--web-addr=:8089"]
8686
ports:
87-
- "8089:8089"
88-
- "9091:9091"
87+
- "58089:8089"
88+
- "59091:9091"
8989
depends_on:
9090
- sources-generator
9191
- sink-prometheus
@@ -122,7 +122,7 @@ services:
122122
depends_on:
123123
- sink-prometheus
124124
ports:
125-
- "5000:5000"
125+
- "55000:5000"
126126

127127
# PostgreSQL Reports Generator - Runs reports after 1 hour
128128
postgres-reports:
@@ -142,17 +142,17 @@ services:
142142
sh -c "
143143
echo 'Installing Python dependencies...' &&
144144
pip install -r requirements.txt &&
145-
echo 'Waiting 30 minutes before generating reports...' &&
146-
sleep 1800 &&
145+
echo 'Waiting 5 minutes before generating reports...' &&
146+
sleep 300 &&
147147
echo 'Starting PostgreSQL reports generation...' &&
148148
while true; do
149149
echo 'Generating PostgreSQL reports...' &&
150150
if [ -f /app/.pgwatch-config ] && grep -q '^api_key=' /app/.pgwatch-config; then
151151
API_KEY=$$(grep '^api_key=' /app/.pgwatch-config | cut -d'=' -f2) &&
152-
python postgres_reports.py --prometheus-url http://sink-prometheus:9090 --output /app/all_reports_$$(date +%Y%m%d_%H%M%S).json --upload --token $$API_KEY --project postgres-ai-monitoring
152+
python postgres_reports.py --prometheus-url http://sink-prometheus:9090 --output /app/all_reports_$$(date +%Y%m%d_%H%M%S).json --token $$API_KEY --project postgres-ai-monitoring
153153
else
154154
echo 'No API key configured, generating reports without upload...' &&
155-
python postgres_reports.py --prometheus-url http://sink-prometheus:9090 --output /app/all_reports_$$(date +%Y%m%d_%H%M%S).json
155+
python postgres_reports.py --prometheus-url http://sink-prometheus:9090 --output /app/all_reports_$$(date +%Y%m%d_%H%M%S).json --no-upload
156156
fi &&
157157
echo 'Reports generated. Sleeping for 24 hours...' &&
158158
sleep 86400

postgres_ai

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -894,12 +894,12 @@ start_services() {
894894

895895
if is_demo_mode; then
896896
log_info "Starting Postgres AI services (demo mode - including target database)..."
897-
$compose_cmd -f "$COMPOSE_FILE" up -d
897+
$compose_cmd -f "$COMPOSE_FILE" up -d --build
898898
else
899899
log_info "Starting Postgres AI monitoring services (production mode)..."
900900
log_info "Target demo database not included - add your own PostgreSQL instances to monitor"
901901
# Start all services except target-db
902-
$compose_cmd -f "$COMPOSE_FILE" up -d sources-generator sink-postgres sink-prometheus pgwatch-postgres pgwatch-prometheus grafana flask-backend postgres-reports
902+
$compose_cmd -f "$COMPOSE_FILE" up -d sources-generator sink-postgres sink-prometheus pgwatch-postgres pgwatch-prometheus grafana flask-backend postgres-reports --build
903903
fi
904904

905905
log_success "Services started!"

0 commit comments

Comments
 (0)