npx is not available in the nix container. Call prisma directly via node node_modules/prisma/build/index.js instead. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
15 lines
467 B
Bash
15 lines
467 B
Bash
#!/bin/sh
|
|
set -e
|
|
|
|
# Auto-generate AUTH_SECRET if not provided
|
|
if [ -z "$AUTH_SECRET" ]; then
|
|
AUTH_SECRET="$(node -e "console.log(require('crypto').randomBytes(32).toString('base64'))")"
|
|
export AUTH_SECRET
|
|
echo "AUTH_SECRET was not set — generated a temporary secret for this container."
|
|
fi
|
|
|
|
# Run Prisma migrations (use local node_modules binary, not npx)
|
|
node node_modules/prisma/build/index.js migrate deploy
|
|
|
|
# Start the Next.js server
|
|
exec node server.js
|