How to dockerize Node + Prisma
node.js - How to use Prisma to generate database tables in Docker - Stack Overflow
Need Docker Prisma Express example
node.js - Using prisma in a dockerfile? - Stack Overflow
TLDR: Does anyone have a tutorial on how to set up Node (Next.js) + Prisma + Postgres with Docker Compose in 2023?
Hey everyone! I'm a junior Python developer who has been getting into web dev lately, and I've been struggling on a problem for days without a solution. I was hoping someone here might be able to help!
Specifically, I'm having trouble dockerizing a Next.js application that uses Prisma + Postgres. I'm hoping someone might be able to provide some guidance on how to do this in 2023. All of the tutorials I've seen have had different methods of doing this, some using deprecated compose features, some setting up Prisma as a separate service, etc. Any guidance is appreciated!
HI
i recently tried to use docker with Prisma node express, I struggle that my express server can not connect to MySQL via Prisma, I try
prisma url use container name
add connection delay before mysql conplete load
change node verison 14 to 18
I literally try and search every possible way from Stackoverflow
can someone share the example?
my github : https://github.com/Jimmy1186/docker-prisma-test
EDIT:
thanks everyone help, i success connect to mysql container,
I am trying to dockerize a Node server running Express and Prisma, and an instance of Postgres.
The goal is to have a single repo, where I can type docker-compose up and everything is spun up at once, in the right order. From what I have found online, it seems that the Postgres container needs to be fully functioning before the Node container should spin up.
At which point in this chain should the PrismaClient information be generated/copied, and using what command? npx prisma generate or npx prisma migrate dev or something else?
I am a bit burnt out on this, to the point that I've tried probably 20 different solutions, Dockerfiles, docker-compose files, tweaking, resetting, etc. With that being said, I'm probably not even articulating what is going wrong properly.
Does anyone have an example of a working Dockerfile, docker-compose.yml, the right scripts in package.json, etc. that successfully build a Postgres server, Node server, and handle all of the Prisma requirements in the right order to make composing up/down quick and easy?
Thank you in advance!