Run migrations inside of a Docker container
I have a dockerized Next.js application. The image only contains built application (
dist
folder).
I want to be able to run migrations from within running application container.
My first thought was to create a migration script using the example from docs - https://orm.drizzle.team/docs/migrations and compile it at image building stage. However, I don't have enough experience with tsc
to accomplish the goal.
I don't want to use tsx
as this would add complexity to the image (eg. copy all of the dependencies for db.ts
) .
How would you accomplish this?Drizzle ORM - Migrations
Drizzle ORM is a lightweight and performant TypeScript ORM with developer experience in mind.
0 Replies