CA
Crawlee & Apify9mo ago
jolly-crimson

Crash on using Prisma, generate and schema

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
Pastebin
{ "name": "sextou-scraping", "version": "1.0.0", "description": ...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
2024-10-04T19:18:29.638Z ACTOR: Cloning [email protected]:didiraja/sex...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Pastebin
2024-10-04T19:20:56.726Z ACTOR: Pulling Docker image of build WuC7d...
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
4 Replies
Hall
Hall9mo ago
View post on community site
This post has been pushed to the community knowledgebase. Any replies in this thread will be synced to the community site.
Apify Community
jolly-crimson
jolly-crimsonOP8mo ago
Can anyone help with this? @Lukas Celnar @Saurav Jain
ondro_k
ondro_k8mo ago
Hey, we use multistage docker image builds 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, generated files are stored in node_modules/.prisma/client, so you should just copy them same way as dist folder:
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
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
Medium
Multistage Image Builds in Docker: A Comprehensive Guide from Basic...
The way we create Docker images for our applications has evolved since Docker’s inception. One of the most powerful advancements in Docker…
jolly-crimson
jolly-crimsonOP7mo ago
@ondro_k i'll try but really thanks in advance for the response, it already answer some questions

Did you find this page helpful?