Prisma migrate deploy docker optimization/improvement
Heyo, I am currently creating an app with t3 app and using prisma and postgres for the database.
Also I'm using the standalone configuration and bundling a postgres server with the application using docker.
My Question: How can i run
prisma db migrate deploy
on the running server in the best way?
The docs say that you should run it in a ci/cd pipeline after the server is deployed. That would kinda work but for now I just have a vps which i want to deploy to (possible with github actions but then i have to expose the db, at least locally). The option I have chosen currently is to include a startup script that runs npx prisma migrate deploy
before the server starts. This works but by running npx prisma
I install the prisma package which makes my container image around 200mb larger that without it.
Is this a passible solution or is there a way to solve this situation better?
My entrypoint.sh
looks like this:
My Dockerfile:
0 Replies