Crash on using Prisma, generate and schema
# apify-platform
d
My Actor saves data using Prisma client. But when I run the actor, Crawler says is needed to run prisma generate, although I generated after the build. Any tips on how to solve it? The files are all in /myuser/ folder. my package.json: https://pastebin.com/KqMYk7Ae Apify build log: https://pastebin.com/71LrxCWN Apify run log: https://pastebin.com/fg2dUW0C
h
message has been deleted
d
Can anyone help with this? @celnarapify @Saurav Jain
o
Hey, we use [multistage docker image builds](https://medium.com/@lexitrainerph/multistage-image-builds-in-docker-a-comprehensive-guide-from-basics-to-mastery-5884b547950) to build our actors. TLDR: files generated by
prisma generate
do not end up in the final actor's image, that's being run. Solution should be simple - you just need to copy the files generated by
prisma generate
to the final image. According to [prisma docs](https://www.prisma.io/docs/orm/reference/prisma-cli-reference#generated-assets-2), generated files are stored in
node_modules/.prisma/client
, so you should just copy them same way as
dist
folder:
Copy code
docker
COPY --from=builder --chown=myuser /home/myuser/dist ./dist

# Copying files from `prisma generate` to the final image
COPY --from=builder --chown=myuser /home/myuser/node_modules/.prisma/client ./node_modules/.prisma/client # <<< add this line to your dockerfile
Let me know if this helped
d
@ojk_001 i'll try but really thanks in advance for the response, it already answer some questions