when running postgres in docker, drizzle cannot connect to it, says database doesnt exist

basically all i did is ./start-database.sh the env updated itself but it says that databse does not exist :/ i checked in docker desktop and the container is running
6 Replies
Down
DownOP3w ago
it works only when instead of localhost i put my local ip
nqhtrung
nqhtrung3w ago
localhost in docker refers to its own network - the network inside docker container. Instead of using localhost, try to use the container name in docker. Make sure you have all the services in the same network. It’s worth reading up on docker network for these kinds of issues.
Down
DownOP3w ago
but i dont access it from inside docker, i access it from outside
nqhtrung
nqhtrung3w ago
have you map localhost to 127.0.0.1?
Down
DownOP3w ago
No description
Down
DownOP3w ago
so in the database connection string i tried: localhost 127.0.0.1 0.0.0.0 (container_name) 192.168. ... (my local ip) <- only this one works

Did you find this page helpful?