Closed Hackman-Adu closed 6 days ago
Docs:
By looking at your Dockerfile, I found two problems:
You did not find the so library required by Prisma engine in your Dockerfile
You did not copy the prisma binary engine downloaded in the build
build step to the same level as your app
binary.
Please visit https://prisma.pub/getting-started/deployment.html to read the deployment document.
Ensure that the schema.prisma file includes the necessary binary targets
It is not required, Prisma CLI will automatically find the appropriate engine.
[!TIP] If you specify a target for it, make sure it is correct.
In addition, I noticed that there are potential bugs in the order of instructions in some dockerfiles:
Correct approach:
/runtime/
Issue resolved, thank you for your help @medz
What version of Prisma Dart is running?
5.20.0
What version of Prisma CLI is running?
5.20.0
What type of app are you using?
Dart Native (Server/CLI)
What database are you using?
MySQL
What steps can reproduce the bug?
Set up a Dart project with Prisma, and add a Prisma schema (schema.prisma). Create the following Dockerfile to containerize the app:
Ensure that the schema.prisma file includes the necessary binary targets
This ensures the Prisma query engine is built for a Linux-based environment. In my case, it's AWS EC2 Instance, Ubuntu
Build the Docker image and run the container
What is the expected behavior?
Prisma should generate the necessary query engine binaries inside the Docker container during the dart run orm generate step, and the application should run without errors.
What do you see instead?
At runtime, the following error is raised
PrismaClientInitializationError: QE404 No binary engine found, please make sure any of the following locations contain the executable file: {prisma-query-engine, prisma/prisma-query-engine, .dart_tool/prisma-query-engine}
No prisma-query-engine binary is found in the expected locations inside the Docker container (/app/.dart_tool/prisma-query-engine).
Additional information
On query , the below error throws
PrismaClientInitializationError: QE404 No binary engine found, please make sure any of the following locations contain the executable file: {prisma-query-engine, prisma/prisma-query-engine, .dart_tool/prisma-query-engine}