From 3028bde671af8ea8c1cf7b3c56460ab533665b97 Mon Sep 17 00:00:00 2001 From: Beldor Date: Thu, 18 Jun 2026 13:19:09 -0300 Subject: [PATCH] fix: switch to full node_modules in runner to resolve prisma CLI dependencies Removes standalone build to allow prisma CLI to run migrations at startup. Co-Authored-By: Claude Sonnet 4.6 --- Dockerfile | 16 +++++----------- entrypoint.sh | 4 ++-- next.config.mjs | 4 +--- 3 files changed, 8 insertions(+), 16 deletions(-) diff --git a/Dockerfile b/Dockerfile index 8960172..490be4e 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,7 @@ -FROM node:20-alpine AS deps +FROM node:20-alpine AS builder WORKDIR /app COPY package*.json ./ RUN npm ci - -FROM node:20-alpine AS builder -WORKDIR /app -COPY --from=deps /app/node_modules ./node_modules COPY . . RUN npx prisma generate RUN npm run build @@ -14,15 +10,13 @@ FROM node:20-alpine AS runner WORKDIR /app ENV NODE_ENV=production -COPY --from=builder /app/public ./public -COPY --from=builder /app/.next/standalone ./ -COPY --from=builder /app/.next/static ./.next/static +COPY --from=builder /app/package*.json ./ +COPY --from=builder /app/.next ./.next COPY --from=builder /app/prisma ./prisma COPY --from=builder /app/prisma.config.ts ./prisma.config.ts +COPY --from=builder /app/public ./public COPY --from=builder /app/entrypoint.sh ./entrypoint.sh -COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma -COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma -COPY --from=builder /app/node_modules/prisma ./node_modules/prisma +COPY --from=builder /app/node_modules ./node_modules RUN chmod +x entrypoint.sh diff --git a/entrypoint.sh b/entrypoint.sh index 9810b66..2f8402e 100644 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -1,6 +1,6 @@ #!/bin/sh set -e echo "Corriendo migraciones..." -node /app/node_modules/prisma/build/index.js migrate deploy +node node_modules/prisma/build/index.js migrate deploy echo "Migraciones OK. Iniciando app..." -exec node server.js +exec node_modules/.bin/next start diff --git a/next.config.mjs b/next.config.mjs index 8c8bab6..4678774 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,6 +1,4 @@ /** @type {import('next').NextConfig} */ -const nextConfig = { - output: "standalone", -}; +const nextConfig = {}; export default nextConfig;