Personal favorites tracker: Next.js 16 App Router, Prisma/PostgreSQL, NextAuth v5 credentials auth with admin/friend roles, category-driven custom fields, lending library, optional S3 cover images. Deployment: multi-stage Dockerfile (standalone output) whose entrypoint runs prisma migrate deploy and the idempotent seed on every boot; env validation made lazy so next build works in the secret-free image. See DEPLOY.md for Coolify setup. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
15 lines
400 B
Bash
15 lines
400 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
: "${DATABASE_URL:?DATABASE_URL must be set}"
|
|
: "${AUTH_SECRET:?AUTH_SECRET must be set}"
|
|
|
|
echo "Applying database migrations..."
|
|
./tooling/node_modules/.bin/prisma migrate deploy --schema prisma/schema.prisma
|
|
|
|
echo "Seeding defaults (idempotent)..."
|
|
NODE_PATH=/app/tooling/node_modules ./tooling/node_modules/.bin/tsx prisma/seed.ts
|
|
|
|
echo "Starting Next.js..."
|
|
exec node server.js
|