I am still very new with Docker but I have a docker container running postgresql and I need to connect to it via a c# application.
I have tried using npgsql to connect to my db but get a connection actively refused error. I have also attempted using different ports but I am limited to what I can use because of my apartments network, either way they still returned the same error.
Is using npgsql acceptable for connecting to a db running in a container? Any related posts or examples to accomplish this would be much appreciated.
I have also attempted to connect to the db running bash in a separate container using psql -h host -p port db_name but was also unsuccessful.
Solved
Issue was based on my "docker-machine ip default" being set to 192.168.99.100, this restricted me from connecting using local host 127.0.0.1 or 0.0.0.0. Using the default ip solved all my connection issues through PGAdmin and PGSQL in C#.
Hope this helps anyone with the same issue.