'Using prisma in a dockerfile?
I have a node express project using prisma as the ORM. I want to be able to run prisma migrate and prisma generate in the dockerfile. However these commands do not seem to work in a dockerfile. My question is - is it possible to automate prisma migrations in a dockerfile without user intervention?
Thanks,
Solution 1:[1]
The last part of my Dockerfile is:
#CMD ["yarn", "start"] #commented out
CMD ["bin/startup.sh"]
I no longer do yarn start. Instead I call a script and inside I do the stuff I need:
# --- bin/startup.sh ---
npx prisma generate
npx prisma migrate deploy
yarn start
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | xabitrigo |
