I run postgres in a docker container on oracle cloud. I opened the port with iptables and via the oracle cloud web interface.
Somehow I can still not connect to the database using Datagrip. I also tried postgres.js, because that is what I would like to use to connect to it.
This is what i get, when it is not running:
DBMS: PostgreSQL (no ver.)
Case sensitivity: plain=mixed, delimited=exact
Connection to 000.000.000.000:<port> refused. Check that the hostname and port are correct and that the postmaster is accepting TCP/IP connections.
This is what I get, when the database is running:
DBMS: PostgreSQL (no ver.)
Case sensitivity: plain=mixed, delimited=exact
Der Verbindungsversuch schlug fehl.
The errors I get using postgres.js:
when it is not running:
Error: connect ETIMEDOUT 000.000.000.000:<port>
at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
at __node_internal_exceptionWithHostPort (node:internal/errors:671:12)
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
errno: -4039,
code: 'ETIMEDOUT',
syscall: 'connect',
address: '000.000.000.000:<port>',
port: <port>
}
when it is running:
Error: connect ECONNREFUSED 000.000.000.000:<port>
at __node_internal_captureLargerStackTrace (node:internal/errors:496:5)
at __node_internal_exceptionWithHostPort (node:internal/errors:671:12)
at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1555:16)
at TCPConnectWrap.callbackTrampoline (node:internal/async_hooks:128:17) {
errno: -4078,
code: 'ECONNREFUSED',
syscall: 'connect',
address: '000.000.000.000:<port>',
port: <port>
}
docker-compose.yml
version: '3.8'
services:
postgres:
image: postgres:16.3
restart: always
environment:
POSTGRES_USER: nuxai
POSTGRES_PASSWORD: pass
POSTGRES_DB: nuxai
ports:
- "<port>:<port>"
volumes:
- ./postgres-data:/var/lib/postgresql/data
output of sudo ss -nlpt | grep 5432:
LISTEN 0 65535 0.0.0.0:54320 0.0.0.0:* users:(("docker-proxy",pid=10770,fd=4))
LISTEN 0 65535 [::]:54320 [::]:* users:(("docker-proxy",pid=10777,fd=4))