Dockerize Svelte with Prisma
Hi! Is there any example or recommendation on how to create a Dockerfile for a Svelte 5 app using Prisma for Supabase?
I keep getting the error:
/app/node_modules/.pnpm/@[email protected]/node_modules/.prisma/client/default.js:43
throw new Error('@prisma/client did not initialize yet. Please run "prisma generate" and try to import it again.');
Mi current Dockerfile is:
FROM node:22-alpine AS builder
WORKDIR /app
COPY package*.json .
RUN npm install -g pnpm
RUN pnpm install
COPY . .
RUN pnpx prisma generate
RUN pnpm run build
RUN pnpm prune --prod
FROM node:22-alpine
WORKDIR /app
COPY --from=builder /app/build build/
COPY --from=builder /app/node_modules node_modules/
COPY --from=builder /app/prisma prisma/
COPY package.json .
EXPOSE 3000
ENV NODE_ENV=production
CMD [ "node", "build" ]
1 Reply
Hi @Juanma 🐼 👋
Can you try including
prisma generate
command in your production step?