-
|
I have a server that has PostgreSQL installed locally. On this server I need to upload a project and connect to this locally installed PostgreSQL, and I am stuck at the point where the rails are trying to connect to PostgreSQL. database.yml: deploy.yml: error message: I don't know what I'm doing wrong. Please help me to provide a connection between dockerized rails app and already installed DB on a server. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
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: 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 |
Beta Was this translation helpful? Give feedback.
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:
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