Prisma Migrate: Deploy Migration with Docker #190
Replies: 15 comments 14 replies
|
Beautiful work !!! |
|
Excellent tutorial. |
"scripts": { |
|
Amazing content there! |
|
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? |
|
Thank you my friend - clear, concise and works! |
|
Thanks for the turorial !! any idea? |
|
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 :) |
|
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? |
|
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: |
|
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? |
|
Hello, |
|
Would you use the same strategy if the docker image was deployed on a serverless container ? If no, then what would your strategy be ? |
|
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"? |
|
nice work! |
Uh oh!
There was an error while loading. Please reload this page.
Prisma Migrate: Deploy Migration with Docker
Perform database migration with Prisma Migrate using Docker
https://notiz.dev/blog/prisma-migrate-deploy-with-docker
All reactions