I'm attempting to dockerize an application using Elysia, Bun, and Prisma for deployment on render.com. When running a local docker build, I encounter an error related to Prisma generation.
Error:
failed to solve: process "/bin/sh -c bunx prisma generate" did not complete successfully: exit code: 9
Additionally, when trying to build on my host, I receive:
error: Cannot find module ".prisma/client/index" from "/app/node_modules/@prisma/client/index.js"
Dockerfile:
FROM oven/bun
WORKDIR /app
COPY package.json .
COPY bun.lockb .
COPY prisma .
RUN bun install --production
COPY src src
COPY tsconfig.json .
RUN bunx prisma generate
ENV NODE_ENV production
CMD ["bun", "src/index.ts"]
EXPOSE 3000
I've followed the documentation from Elysia and added the Prisma command. I've tried installing Prisma separately within the container and experimented with different command orders. Being relatively new to Docker and aiming for deployment on render.com, I'm unsure what I'm missing or doing incorrectly. Any guidance would be greatly appreciated.