#!/bin/sh set -e # Apply pending migrations against the database, then start the server. # Invoke the real CLI entry (NOT the .bin/prisma symlink): Node resolves the # bundled .wasm files relative to the script's own directory, so calling the # symlink would look for them under node_modules/.bin/ and fail with ENOENT. echo "Running prisma migrate deploy…" node node_modules/prisma/build/index.js migrate deploy # Ensure the upload directory exists in the mounted volume. mkdir -p "${UPLOAD_DIR:-/data/uploads}" echo "Starting Next.js…" exec node server.js