- First, let’s set up a repo which will hold our test db:
- Add a dockerfile for the test db:
- Start the DB container:
- Copy the data over from the remote DB to your docker DB:
Now you have your DB set up, check it out in your favorite DB application (pg admin, Postico, Prisma Studio etc)
- Given we want to replicate our Prisma setup, not just the DB itself, we need to copy over the Prisma schema and migrations:
- Paste your real prisma schema into the test db schema
- Paste the migrations folder too
- Run
prisma generate
Extras
If you want pg_dump and psql without the full postgres install you can do the following: