Repository navigation
binaryTargets equivalent with @prisma/engines? #30908
|
How can I prime the filesystem with a specific platform engine files to prepare for deploy? with binaryTargets I simply added them like The production host will not be able to download code on the fly. |
Replies: 3 comments 7 replies
|
To prime the filesystem with engine binaries for an offline or air-gapped production host, you have three primary approaches depending on whether you are using standard Approach 1: Recommended Pattern (
|
|
One thing to add: what you need depends on which generator you're on, because Prisma 7 changed this.
So on v7 you run What may still need a native binary is the CLI side: the Schema Engine used by
FROM node:22-bookworm AS build # Debian 12 -> debian-openssl-3.0.x
WORKDIR /app
COPY package*.json ./
RUN npm ci # postinstall fetches whatever the CLI needs for this platform
COPY . .
RUN npx prisma generateIf you can share your Prisma version and which generator |
|
For pre-staging the Schema Engine in Set it in the build environment before installing dependencies, for example with npm and an existing lockfile: PRISMA_CLI_BINARY_TARGETS=debian-openssl-3.0.x npm ciThe Prisma 7 implementation splits this variable on commas and passes those targets to the downloader. If the build machine also needs to execute a native engine, include its concrete target too, such as I tested a clean installation of The file was a Linux ELF binary and its SHA-256 matched Prisma's published checksum. I did not execute that Linux binary or run a migration. Ship that installed package with the deployment artifact, preserving the binary's executable permission on Linux. This covers the CLI Schema Engine; the Rust-free Prisma 7 client/adapter distinction in the previous reply still applies. One correction to the earlier programmatic example: |
Good Questions @gcb
With prisma client on 7.x there’s no native binary on the client side anymore. Prismas Rust-free notes say you do not need to worry about query engines or binaryTargets now, and the old engine file should not appear in your generated folder, so thats an easy way to check. I am not 100% sure if the new query compiler is plain JS or uses Wasm internally, but it is not platform-specific, so your FE hosts only need the generated client plus @prisma/client and @prisma/adapter-pg.
Your Database host plan should work too. The schema engine used by prisma migrate deploy is still a native binary, and its downloaded from Prismas binaries server during install, not from the npm r…