Keep prisma in production dependencies for container migrate.
Prebuilt images copy host node_modules; with omit=dev the CLI was missing and the API crash-looped. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -8,13 +8,17 @@ echo "OpenSSL: $(openssl version 2>/dev/null || echo missing)"
|
||||
DB_HOST=$(printf '%s' "$DATABASE_URL" | sed -n 's|.*@\([^:/]*\).*|\1|p')
|
||||
echo "DATABASE_URL host: ${DB_HOST:-unknown}"
|
||||
|
||||
if [ ! -x ./node_modules/.bin/prisma ]; then
|
||||
echo "ERROR: ./node_modules/.bin/prisma پیدا نشد. روی سرور npm ci بزن."
|
||||
if [ ! -x ./node_modules/.bin/prisma ] && [ ! -f ./node_modules/prisma/build/index.js ]; then
|
||||
echo "ERROR: prisma در node_modules نیست. روی سرور بزن:"
|
||||
echo " npm install prisma --no-audit --no-fund --registry=https://registry.npmmirror.com"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# از npx استفاده نکن — روی بعضی سرورها برای چک رجیستری آویزان میماند
|
||||
PRISMA="./node_modules/.bin/prisma"
|
||||
if [ -x ./node_modules/.bin/prisma ]; then
|
||||
PRISMA="./node_modules/.bin/prisma"
|
||||
else
|
||||
PRISMA="node ./node_modules/prisma/build/index.js"
|
||||
fi
|
||||
|
||||
echo "Waiting for database & applying migrations..."
|
||||
i=0
|
||||
|
||||
Reference in New Issue
Block a user