Prisma Migrate: Deploy Migration with Docker #190
Replies: 15 comments 14 replies
-
Beautiful work !!! |
Beta Was this translation helpful? Give feedback.
-
Excellent tutorial. |
Beta Was this translation helpful? Give feedback.
-
"scripts": {
|
Beta Was this translation helpful? Give feedback.
-
Amazing content there! |
Beta Was this translation helpful? Give feedback.
-
Well, I tried the same way, but I am having error in the build step. This is the output,
I think it is due to prisma generate not working properly, cause the build works outside of docker. Is there any solution, or am I missing any point? |
Beta Was this translation helpful? Give feedback.
-
Thank you my friend - clear, concise and works! |
Beta Was this translation helpful? Give feedback.
-
Thanks for the turorial !! any idea? |
Beta Was this translation helpful? Give feedback.
-
This is great! Exactly what was perplexing me because i wasn't aware CMD runs only when the container is run and not built, which is when I want to run the prisma migration! I do have a question though, in this instance, what is the purpose of the multi-stage build? Could it not be just done in one stage as follows?
Also wouldn't the Thank you so much :) |
Beta Was this translation helpful? Give feedback.
-
Nice work! I have a question about what can be done in case the migration fails? Because in this way the container would stop when the migration fails. If the migration manages to migrate one part but the other part fails, how can we do a rollback? |
Beta Was this translation helpful? Give feedback.
-
I appreciate the article but this method
Instead, I added a command to the docker-compose.yml that does the Here is the error I was seeing going with the method documented above:
|
Beta Was this translation helpful? Give feedback.
-
A problem with this approach (It's the best I've come up with), if the migration takes a while, a lot of dockerized platforms will try to restart the image if the server isn't up and running after X seconds (responds to a /ping-endpoint). I've run in to cases where our platform will try to restart it in the middle of a migration, and then prisma won't be able to mark the migration as finished automatically, since the container that initialised the migration is shut down. Do you have any ideas on how you could solve such problem? |
Beta Was this translation helpful? Give feedback.
-
Hello, |
Beta Was this translation helpful? Give feedback.
-
Would you use the same strategy if the docker image was deployed on a serverless container ? If no, then what would your strategy be ? |
Beta Was this translation helpful? Give feedback.
-
Hi, this is a great tutorial., thanks a lot! When i start npx prisma migrate, obviously prisma must be installed. Normally, in package.json prisma exists in devDependencies and therefore is not available in a production build. Did you move prisma to "dependencies"? |
Beta Was this translation helpful? Give feedback.
-
nice work! |
Beta Was this translation helpful? Give feedback.
-
Prisma Migrate: Deploy Migration with Docker
Perform database migration with Prisma Migrate using Docker
https://notiz.dev/blog/prisma-migrate-deploy-with-docker
Beta Was this translation helpful? Give feedback.
All reactions