Skip to content
Discussion options

You must be logged in to vote

solved:

Docker containers cannot to connect to host using unix socket (https://stackoverflow.com/questions/31324981/how-to-access-host-port-from-docker-container). To solve this need to use an internal address to database for connecting.

i've added:

servers:
  web:
    hosts:
      - myhostname.net
    options:
      add-host: "host.docker.internal:172.17.0.1" 

172.17.0.1 is a default gateway for docker-bridge network, you can try "host.docker.internal:host-gateway"

Before that also pg_hba and postgresconf must be configured for accepting connections. You can also test connectivity using connect inside of container

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by o-200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant