From 5b9a8034b30dff0a593aad9c6dbffb3362ab2a36 Mon Sep 17 00:00:00 2001 From: Rdeisenroth Date: Sat, 8 Nov 2025 16:26:54 +0100 Subject: [PATCH] make prisma work in docker image --- Dockerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index 095c9f4..c5d5d65 100644 --- a/Dockerfile +++ b/Dockerfile @@ -24,12 +24,16 @@ RUN unzip -j bun-linux-*.zip -d /usr/local/bin && \ # this will cache them and speed up future builds FROM base AS install RUN mkdir -p /temp/dev -COPY package.json bun.lock prisma/ /temp/dev/ +COPY package.json bun.lock /temp/dev/ +COPY prisma /temp/dev/prisma/ +RUN sed -i 's|file:../data/mydb.sqlite|file:/app/data/mydb.sqlite|g' /temp/dev/prisma/schema.prisma RUN cd /temp/dev && bun install --frozen-lockfile && bun prisma generate # install with --production (exclude devDependencies) RUN mkdir -p /temp/prod -COPY package.json bun.lock prisma/ /temp/prod/ +COPY package.json bun.lock /temp/prod/ +COPY prisma /temp/prod/prisma/ +RUN sed -i 's|file:../data/mydb.sqlite|file:/app/data/mydb.sqlite|g' /temp/prod/prisma/schema.prisma RUN cd /temp/prod && bun install --frozen-lockfile --production && bun prisma generate FROM base AS prerelease @@ -93,6 +97,7 @@ RUN ARCH=$(uname -m) && \ COPY --from=install /temp/prod/node_modules node_modules COPY --from=prerelease /app/public/ /app/public/ COPY --from=prerelease /app/dist /app/dist +COPY --from=prerelease /app/prisma /app/prisma # COPY . . RUN mkdir data