From e5bae66363958dde075e837a0b7a2aba3a4cbfa9 Mon Sep 17 00:00:00 2001 From: headlessdev Date: Wed, 30 Apr 2025 14:57:19 +0200 Subject: [PATCH] Dockerfile prisma fix --- Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 72a9f7e..3adcbae 100644 --- a/Dockerfile +++ b/Dockerfile @@ -25,22 +25,23 @@ RUN npm run build FROM --platform=$TARGETPLATFORM node:20-alpine AS production WORKDIR /app -COPY package.json package-lock.json* ./ -# nur Production-Deps -RUN npm ci --only=production +ENV NODE_ENV production +ENV PRISMA_CLI_BINARY_TARGETS="linux-musl-arm64-openssl-3.0.x" -# dann restliche Dateien kopieren +COPY --from=builder /app/node_modules ./node_modules COPY --from=builder /app/prisma ./prisma COPY --from=builder /app/.next ./.next COPY --from=builder /app/public ./public +COPY --from=builder /app/package.json ./package.json COPY --from=builder /app/next.config.js* ./ +RUN npm prune --production + EXPOSE 3000 CMD ["sh", "-c", "npx prisma migrate deploy && npm start"] - # - - BUILD COMMAND - - # docker buildx build \ # --platform linux/amd64,linux/arm64,linux/arm/v7 \