From 44f480bd91eb79eb17f78e72e8ad27dbce236625 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Wed, 9 Aug 2023 16:03:57 +0200 Subject: [PATCH 1/2] Avoid exposing postgres ports as they might collide with a running PG instance This comes from Vaclav's advice given that kind of port collisions are quite likely to happen. --- docker-compose.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 98f030a..0c244fd 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -102,8 +102,6 @@ services: - ./postgres_cfg/postgresql.conf:/etc/postgresql/postgresql.conf - ./postgres_cfg/db.sql:/docker-entrypoint-initdb.d/db.sql command: postgres -c config_file=/etc/postgresql/postgresql.conf - ports: - - 5432:5432 healthcheck: test: ["CMD-SHELL", "pg_isready", "-d", "db_prod"] interval: 30s @@ -119,8 +117,6 @@ services: volumes: - ./monitoring/configuration/postgres-exporter.yml:/etc/pgexporter/postgres-exporter.yml - ./monitoring/configuration/pg-exporter-queries.yml:/etc/pgexporter/queries.yml - ports: - - 9187:9187 command: # Both the config file and 'DATA_SOURCE_NAME' should contain valid connection info - --config.file=/etc/pgexporter/postgres-exporter.yml From 6dd62d26a1dd1da2dc3096a23b9d7d5ebe1b9ca2 Mon Sep 17 00:00:00 2001 From: Ivan Folgueira Bande Date: Wed, 9 Aug 2023 16:04:49 +0200 Subject: [PATCH 2/2] Restrict the grafana's port to be accessible from localhost This is to align with the comment in the README.md. --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 0c244fd..42f6038 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -87,7 +87,7 @@ services: - ./monitoring/configuration/customizations/custom-logo.svg:/usr/share/grafana/public/img/grafana_typelogo.svg:Z - ./monitoring/configuration/customizations/custom-logo.png:/usr/share/grafana/public/img/fav32.png:Z ports: - - 3000:3000 + - 127.0.0.1:3000:3000 restart: on-failure depends_on: - prometheus