Compare commits

..

2 Commits

Author SHA1 Message Date
bc9a13bfe4 Merge pull request 'fix: copy prisma.config.ts into runner so db push can find datasource URL' (#11) from claude/reverent-proskuriakova into master
Reviewed-on: #11
2026-03-13 00:45:12 -05:00
cfeee5dc2a fix: copy prisma.config.ts into runner so db push can find datasource URL
Without prisma.config.ts in the runner stage, prisma db push has no
datasource URL (schema.prisma no longer carries url in Prisma 7) and
silently skips creating the database. Also add set -e to the entrypoint
so any db push failure is visible in logs and stops the container.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-13 00:44:41 -05:00

View File

@@ -44,6 +44,7 @@ RUN chown nextjs:nodejs .next
COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
COPY --from=builder --chown=nextjs:nodejs /app/prisma ./prisma
COPY --from=builder --chown=nextjs:nodejs /app/prisma.config.ts ./prisma.config.ts
COPY --from=deps --chown=nextjs:nodejs /app/node_modules ./node_modules
# Create data directory AFTER all copies so permissions are never clobbered
@@ -58,7 +59,10 @@ ENV PORT=3000
# script to run migrations before starting
COPY --chown=nextjs:nodejs <<EOF /app/entrypoint.sh
#!/bin/sh
set -e
echo "Running prisma db push..."
npx prisma db push --accept-data-loss
echo "Starting server..."
node server.js
EOF