You can choose any of these two options:
- Make your postgresql listen to all your network interfaces (or the docker bridge for more secure but complex setup), to achieve that you need to make sure your config looks like this:
# grep listen /var/lib/pgsql/data/postgresql.conf listen_addresses = '*'
- Use host network mode in your docker compose, which runs docker in your host network name space instead of creating a new network:
CLICK HERE to find out more related problems solutions.