0

I am trying to run a postgresql9.5 container using docker-compose (docker 17.06, compose 1.16 compose-file v2):

   postgis:
    build:
       context: ./postgis
    environment:
       ALLOW_IP_RANGE: "0.0.0.0/0"
    healthcheck:
        test: ["CMD", "nc", "-zv", "localhost", "5432"]
        interval: 30s
        timeout: 10s
        retries: 5
    container_name: postgis
    networks:
         vpcbr:
            ipv4_address: 10.10.10.3

I am using a bridged network to build the composition

The postgresql setup can be found here

https://github.com/kartoza/docker-postgis

There is a start.sh script and set-postgis.sh, those modifie pg_hba.conf to use 0.0.0.0 (accept everything)

host    all             all             0.0.0.0/0              md5

my postgresql.conf is listening to all IPs:

listen_addresses = '*' 

I have tried to set the listen_address to 10.10.10.3 and even 0.0.0.0 (?) but nothing seems to work and the postgresql doesnt bing to the ip of the composition, postgresql only works on localhost

Is there something that I am overlooking ??

Jorge Mendes
  • 306
  • 1
  • 2
  • 11

1 Answers1

1

docker exec into the container and check what postgres is binding to:

netstat -plunt
ss -plunt
lsof -iTCP -sTCP:LISTEN
ptman
  • 27,124
  • 2
  • 26
  • 45
  • I have rerun the composition on and other computer and it runs without problems (docker v17 and docker-compose version 1.14.0). I can see port 5432 open and accepting connections into the postgis: 4cad8050453c:postgresql geoserver.inspire:60392 ESTABLISHED – Jorge Mendes Sep 04 '17 at 08:31
  • I have postgis with: listen_addresses = '0.0.0.0' port = 5432 – Jorge Mendes Sep 04 '17 at 08:37