From b9475f594d1206f1fdb94a4df92f11056e03767f Mon Sep 17 00:00:00 2001 From: Mark Crossfield Date: Mon, 9 May 2022 11:00:11 +0100 Subject: [PATCH] Fix #8 by removing postgres port map MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We don’t need to expose the postgres port on the host. The containers communicate via their own ports on the bridge network. Exposing the postgres port on `5432` can lead to port clashes with existing postgres instances. If we want to expose postgres, we should do it on something like port `54321`, *but* we don’t need to change the connect strings etc elsewhere as they still communicate via `5432` on the bridge network. --- docker-compose.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index f5d4b7b..5891963 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,8 +6,6 @@ services: - database.env # configure postgres volumes: - database-data:/var/lib/postgresql/data/ # persist data even if container shuts down - ports: - - "5432:5432" populate-database: profiles: - initialise