Fix: copy full node_modules into runner for prisma/seed support
Build and Push Docker Image / build (push) Successful in 8m24s Details

Cherry-picking individual prisma modules fails due to transitive
deps (effect, @prisma/config, etc). Copy full node_modules instead.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Matt 2026-01-30 18:51:37 +01:00
parent c2506edd52
commit e686a73b75
2 changed files with 6 additions and 15 deletions

View File

@ -41,28 +41,19 @@ RUN adduser --system --uid 1001 nextjs
# Install runtime dependencies for migrations and seeding # Install runtime dependencies for migrations and seeding
RUN apk add --no-cache libc6-compat RUN apk add --no-cache libc6-compat
# Copy built files # Copy built Next.js standalone output
COPY --from=builder /app/public ./public COPY --from=builder /app/public ./public
COPY --from=builder /app/.next/standalone ./ COPY --from=builder /app/.next/standalone ./
COPY --from=builder /app/.next/static ./.next/static COPY --from=builder /app/.next/static ./.next/static
COPY --from=builder /app/prisma ./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/prisma ./node_modules/prisma
# Copy seed dependencies (for manual seeding via docker exec) # Copy full node_modules for prisma migrations and seeding
COPY --from=builder /app/node_modules/bcryptjs ./node_modules/bcryptjs COPY --from=builder /app/node_modules ./node_modules
COPY --from=builder /app/node_modules/papaparse ./node_modules/papaparse COPY --from=builder /app/prisma ./prisma
COPY --from=builder /app/node_modules/tsx ./node_modules/tsx COPY --from=builder /app/package.json ./package.json
COPY --from=builder /app/node_modules/esbuild ./node_modules/esbuild
COPY --from=builder /app/node_modules/@esbuild ./node_modules/@esbuild
# Copy CSV data file for manual seeding # Copy CSV data file for manual seeding
COPY --from=builder /app/docs/candidatures_2026.csv ./docs/candidatures_2026.csv COPY --from=builder /app/docs/candidatures_2026.csv ./docs/candidatures_2026.csv
# Copy package.json for npx/module resolution
COPY --from=builder /app/package.json ./package.json
# Copy entrypoint script # Copy entrypoint script
COPY docker/docker-entrypoint.sh /app/docker-entrypoint.sh COPY docker/docker-entrypoint.sh /app/docker-entrypoint.sh
RUN chmod +x /app/docker-entrypoint.sh RUN chmod +x /app/docker-entrypoint.sh

View File

@ -2,7 +2,7 @@
set -e set -e
echo "==> Running database migrations..." echo "==> Running database migrations..."
node node_modules/prisma/build/index.js migrate deploy npx prisma migrate deploy
echo "==> Starting application..." echo "==> Starting application..."
exec node server.js exec node server.js