A developer updates a Dockerfile and Docker Compose configuration to integrate Prisma into a reservations service. The process includes running migrations, generating client types, setting up database dependencies, and verifying the successful build and startup of the application containers.
Length 8:41
Captions English (Generated), Spanish (Auto-translated), French (Auto-translated), Korean (Auto-translated), Portuguese (Auto-translated), Vietnamese (Auto-translated) #prisma #docker #docker-compose #migrations #typescript #postgresql #refactoring #backend #pnpm #configuration
0:00 All right, so now that we've refactored our app to work with 0:03 Prisma 0:04 instead of our abstract repository, let's go ahead and now update our 0:08 reservations Docker file, which needs some updates to work with this 0:11 Prisma setup. 0:13 So head back into the Docker file, and we're gonna make a few changes. 0:17 So the first of which is in the development stage of our Docker 0:20 file, we're gonna 0:21 go ahead and copy over our Prisma schema directory 0:25 into the container. So that's so that we have our 0:28 migrations copied over as well as the schema Prisma, 0:32 because there's two things we want to accomplish in this Docker file. 0:36 The first of which is actually generate the client types 0:39 that we 0:40 know our application needs to build and run. 0:43 Secondly, we want to actually trigger these 0:46 migrations to 0:47 run once we start our application up, so our production database is 0:51 always in line with our schema every time we start up the app. 0:55 So we need this Prisma folder to do this. 0:58 Let's go ahead and a- after this copy command, we go ahead 1:01 and also 1:02 copy 1:03 app/reservations/prisma 1:07 and copy this into the Prisma folder locally. 1:11 We now want to actually run the Prisma generate command to 1:14 generate our client types from our schema, and Prisma will 1:18 automatically look for a Prisma folder in the current directory when 1:22 we run this command, and it will have the Prisma folder from 1:26 reservations because we're copying it in this line. 1:29 So after we pnpm install, let's now run 1:32 pnpm prisma generate. So this is gonna 1:36 generate the client types, which in our case we've already done after 1:39 we ex... 1:40 So now that we have our Prisma client types generated and available 1:43 when we build 1:44 our code, let's now scroll down to the last part of
The rest of the transcript is for members.
Sign in