Closed Harryalways317 closed 3 months ago
Unless you require access from another machine, then remove the ports:
config from your docker-compose.yml
. If the database host is accessible on the internet, then anyone can attempt to connect. Which is what I would guess is happening; there isn't anything in the container that would auto drop tables or databases. If you do need other hosts to access it, then choose an extremely strong password and setup something like AWS security groups to limit network access (local solutions like firewalld
and iptables
will not work since docker
works with/around those to make the port exposed when you use ports
).
@yosifkit yes i understood that, but the issue is the ports is for the local docker container to access, and the instance is under vpc, so no outer people can access it,
the issue is, after some time, the error i mentioned (database "template0" is not currently accepting connections), is coming up and then the dropping is happening, to confirm this, i tried multiple other times with same config, same error is happening,
but other pg under same docker where i access tables with prisma, its not happening, so i was guessing there is issue in my config or the way i'm accessing
Hi, I'm facing this error from multiple days, it happens on postgres inside docker.
It happens mostly after a hour,
the below is the service inside docker compose
init.sql
the connection im making
Any where i'm doing it wrong?