Next.js app with prisma database can't connect with each other #992
-
Hi Everyone, I have a next.js app that is deployed on Dokploy with a Dockerfile. I also have a seperate mysql database on dokploy successfully running. I use the "Internal Connection URL" that dokploy provides as the value of the DATABASE_URL that prisma requires. The build of the next.js app fails on the "Generating static pages" phase, because it can't connect to the database (the .env value is picked up, because I see the name of the database, but it fails to connect regardless). I also tried to make the database available over the internet, but I have to open port 3306 on my firewall which isn't something I want. I suspect it's because of "dokploy-network" that I have to set inside my Dockerfile, but unsure how and if that's going to help. I'd appreciate if anyone could provide some insight in the matter. Thanks in advance. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
You need to expose it and use the external connection string. |
Beta Was this translation helpful? Give feedback.
You need to expose it and use the external connection string.