What’s the best practice for accessing postgresql locally? my way now is replacing the postgresql listen_addresses with the en0 network and accessing it in from the container . is it safe? to be more secure what should be considered?
Docker Desktop? Docker-CE?
On Docker Desktop, you should be able to use host.docker.internal
as hostname, to access services on the host.
See: Explore networking features on Docker Desktop | Docker Documentation
On Docker-CE, you could bind your host service to the ip of docker0 (by default 172.17.0.1), and use the same ip to access the host service from inside a container.