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:
2026-08-08 15:54:23 +03:30
co-authored by Cursor
parent 4e48275054
commit 25d9038632
2 changed files with 9 additions and 5 deletions
+8 -4
View File
@@ -8,13 +8,17 @@ echo "OpenSSL: $(openssl version 2>/dev/null || echo missing)"
DB_HOST=$(printf '%s' "$DATABASE_URL" | sed -n 's|.*@\([^:/]*\).*|\1|p') DB_HOST=$(printf '%s' "$DATABASE_URL" | sed -n 's|.*@\([^:/]*\).*|\1|p')
echo "DATABASE_URL host: ${DB_HOST:-unknown}" echo "DATABASE_URL host: ${DB_HOST:-unknown}"
if [ ! -x ./node_modules/.bin/prisma ]; then if [ ! -x ./node_modules/.bin/prisma ] && [ ! -f ./node_modules/prisma/build/index.js ]; then
echo "ERROR: ./node_modules/.bin/prisma پیدا نشد. روی سرور npm ci بزن." echo "ERROR: prisma در node_modules نیست. روی سرور بزن:"
echo " npm install prisma --no-audit --no-fund --registry=https://registry.npmmirror.com"
exit 1 exit 1
fi fi
# از npx استفاده نکن — روی بعضی سرورها برای چک رجیستری آویزان می‌ماند if [ -x ./node_modules/.bin/prisma ]; then
PRISMA="./node_modules/.bin/prisma" PRISMA="./node_modules/.bin/prisma"
else
PRISMA="node ./node_modules/prisma/build/index.js"
fi
echo "Waiting for database & applying migrations..." echo "Waiting for database & applying migrations..."
i=0 i=0
+1 -1
View File
@@ -50,6 +50,7 @@
"dotenv": "^17.4.2", "dotenv": "^17.4.2",
"passport": "^0.7.0", "passport": "^0.7.0",
"passport-jwt": "^4.0.1", "passport-jwt": "^4.0.1",
"prisma": "^6.19.3",
"reflect-metadata": "^0.2.2", "reflect-metadata": "^0.2.2",
"rxjs": "^7.8.1" "rxjs": "^7.8.1"
}, },
@@ -72,7 +73,6 @@
"globals": "^17.0.0", "globals": "^17.0.0",
"jest": "^30.0.0", "jest": "^30.0.0",
"prettier": "^3.4.2", "prettier": "^3.4.2",
"prisma": "^6.19.3",
"source-map-support": "^0.5.21", "source-map-support": "^0.5.21",
"supertest": "^7.0.0", "supertest": "^7.0.0",
"ts-jest": "^29.2.5", "ts-jest": "^29.2.5",