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.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hi @akifmursalov,
The Firewall/Authorized Access always comes to mind when someone is experiencing such issues.
See if you have allowed access to the said Database from the place where you are connecting.
What is your Database connection string? To where it should connect to, are you using DigitalOcean’s Managed Database? If yes, check the following tutorial on how to connect;
https://docs.digitalocean.com/products/databases/postgresql/how-to/connect/