Report this

What is the reason for this report?

PrismaClientInitializationError: Can't reach database server at `db`:`5432`

Posted on January 7, 2023

I have a project on Nest.js that I want to deploy to DigitalOcean apps. I am creating several containers (database container and app container). As database I use postgresql, ORM is prisma. But while I am trying to deploy my project I get an error that says that my database is not running in the given server (PrismaClientInitializationError: Can’t reach database server at db:5432).‘db’ is the name of my container that creates in docker-compose.yml file. What could be the problem causing this? I tried to change the server name (‘db’) to my application server name, but it did not solved the problem.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.