Docker error Can't reach database server at localhost:5432
I'm using docker compose and my server api depends on a postgres server in the same container. During the build I run and get this error. I also tried replacing localhost with 0.0.0.0 and db (my database's docker service name) but it does not work. Strangely from my dev machine I'm able to run without issue using this same DATABASE_URL variable.
4 Replies
Note also I am able to run without issue from docker
Hi @jsoneaday 👋
Can you please share the content of your docker-compose.yml file?
I moved my prisma code from the docker run command into cmd and it worked. Thank you
Thank you for sharing the solution.