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 <noreply@anthropic.com>
This commit is contained in:
Beldor
2026-06-18 13:19:09 -03:00
parent fb92021bf6
commit 3028bde671
3 changed files with 8 additions and 16 deletions
+5 -11
View File
@@ -1,11 +1,7 @@
FROM node:20-alpine AS deps FROM node:20-alpine AS builder
WORKDIR /app WORKDIR /app
COPY package*.json ./ COPY package*.json ./
RUN npm ci RUN npm ci
FROM node:20-alpine AS builder
WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . . COPY . .
RUN npx prisma generate RUN npx prisma generate
RUN npm run build RUN npm run build
@@ -14,15 +10,13 @@ FROM node:20-alpine AS runner
WORKDIR /app WORKDIR /app
ENV NODE_ENV=production ENV NODE_ENV=production
COPY --from=builder /app/public ./public COPY --from=builder /app/package*.json ./
COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next ./.next
COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./prisma COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/prisma.config.ts ./prisma.config.ts 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/entrypoint.sh ./entrypoint.sh
COPY --from=builder /app/node_modules/.prisma ./node_modules/.prisma COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/node_modules/@prisma ./node_modules/@prisma
COPY --from=builder /app/node_modules/prisma ./node_modules/prisma
RUN chmod +x entrypoint.sh RUN chmod +x entrypoint.sh
+2 -2
View File
@@ -1,6 +1,6 @@
#!/bin/sh #!/bin/sh
set -e set -e
echo "Corriendo migraciones..." 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..." echo "Migraciones OK. Iniciando app..."
exec node server.js exec node_modules/.bin/next start
+1 -3
View File
@@ -1,6 +1,4 @@
/** @type {import('next').NextConfig} */ /** @type {import('next').NextConfig} */
const nextConfig = { const nextConfig = {};
output: "standalone",
};
export default nextConfig; export default nextConfig;