Hey what is the best way to dockerize a node.js ap...
# prisma-client
k
Hey what is the best way to dockerize a node.js app using Typescript and Prisma without installing dev dependencies in the final image ? Do you have any tutorials for that ?
r
I don’t know of any tutorials, but you can use multi-stage builds where you generate
PrismaClient
in the first stage and then copy that to the final stage. Also having
prisma
in
devDependencies
is recommended where you only install production dependencies in the final stage.
@Dominic Hadfield Are you aware of any tutorials for this?
d
not of the top of my head, let me have a dig
👍 2
I will look through our own setup to see what we are doing
🙌 2
k
@Ryan Yes I have prisma in
devDependencies
but I did not find any way to generate prisma client and install only prod dependencies in the final image. @Dominic Hadfield Thanks for checking
d
I dont have any tutorials to hand but I reckon you build in ci that uses dev environment and then pushes a versioned image with the artefacts to the registry. Then you can take the version of that image from the registry of the output and serve that container