I have installed an instance of parse-server with docker. I have my DB on the Host, but when I run the docker, it says error on connecting to the DB.
docker run -t -d --name parse-server parseplatform/parse-server --appName appname --appId appid--masterKey masterkey --clientKey clientkey --databaseURI postgres://example:1234563@localhost/parse-server --serverURL http://sync.example.com:1337/parse --verbose --publicServerURL http://sync.example.com
And I am getting this error:
Error: connect ECONNREFUSED 127.0.0.1:5432
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1141:16) {
errno: 'ECONNREFUSED',
code: 'ECONNREFUSED',
syscall: 'connect',
address: '127.0.0.1',
port: 5432
}
I tried with --network host
but parse-server is giving me {"error":"unauthorized"}
using this docker.
I tried also using -o 5432:5432
, but it said the port is used, because the instance running on the host.
How can I connect to the PostgreSQL on the host from the docker parse-server without using --network host
?