medz / prisma-dart

Prisma Client Dart is an auto-generated type-safe ORM. It uses Prisma Engine as the data access layer and is as consistent as possible with the Prisma Client JS/TS APIs.
https://prisma.pub
BSD 3-Clause "New" or "Revised" License
450 stars 30 forks source link

ProcessException: No such file or directory #284

Closed kensamare closed 10 months ago

kensamare commented 10 months ago

I have developed a small Dart server using Dart Frog, which incorporates Prisma ORM for database operations. However, when attempting to execute queries within a Docker container, I encounter the following error

ProcessException: No such file or directory
Command: /query-engine-darwin-arm64 --enable-raw-queries --enable-metrics --enable-open-telemetry --port 41941 --host 127.0.0.1
# Official Dart image: https://hub.docker.com/_/dart
# Specify the Dart SDK base image version using dart:<version> (ex: dart:2.17)
FROM dart:stable AS build

WORKDIR /app

# Copy Dependencies

# Install Dependencies

RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - &&\
    apt-get install -y nodejs

# Resolve app dependencies.
COPY pubspec.* ./
RUN dart pub get

# Copy app source code and AOT compile it.
COPY . .
# Ensure packages are still up-to-date if anything has changed
RUN npm install -g prisma@4.16.0
RUN dart pub get --offline
RUN dart compile exe bin/server.dart -o bin/server
# Build minimal serving image from AOT-compiled `/server` and required system
# libraries and configuration files stored in `/runtime/` from the build stage.
RUN npx prisma generate

FROM scratch
COPY --from=build /runtime/ /
COPY --from=odroe/prisma-dart:latest / /
COPY --from=build /app/bin/server /app/bin/
COPY --from=build /app/prisma/query-engine-* /

# Start server.
CMD ["/app/bin/server"]
medz commented 10 months ago

Fixed, binary engine files will now be automatically copied to the client output directory.

image
medz commented 10 months ago

v3.4.5 fixed.