Fix Docker deploy Prisma build

This commit is contained in:
2026-05-07 14:11:10 +03:30
parent 4476fbd9d8
commit 49cd41788c
33 changed files with 51859 additions and 61 deletions

View File

@@ -1,28 +1,19 @@
# اسکریپت کپی کردن Prisma generated files برای deployment
Write-Host "Generating Prisma client for deployment..." -ForegroundColor Cyan
Write-Host "Copying Prisma generated files..." -ForegroundColor Cyan
npx prisma generate
if ($LASTEXITCODE -ne 0) {
exit $LASTEXITCODE
}
# ساخت پوشه
New-Item -ItemType Directory -Force -Path "prisma/generated" | Out-Null
# بررسی وجود فایل‌ها
if (-not (Test-Path "node_modules/.prisma/client")) {
Write-Host "Error: Prisma client not found!" -ForegroundColor Red
Write-Host "Please run: npm install && npx prisma generate" -ForegroundColor Yellow
if (-not (Test-Path "lib/generated/prisma/index.js")) {
Write-Host "Error: lib/generated/prisma/index.js was not created." -ForegroundColor Red
exit 1
}
# کپی کردن
Write-Host "Copying .prisma/client..." -ForegroundColor Green
Copy-Item -Recurse -Force "node_modules/.prisma/client" "prisma/generated/.prisma-client"
Write-Host "Copying @prisma/client..." -ForegroundColor Green
Copy-Item -Recurse -Force "node_modules/@prisma/client" "prisma/generated/@prisma-client"
Write-Host ""
Write-Host "✓ Files copied successfully!" -ForegroundColor Green
Write-Host "Prisma client generated successfully." -ForegroundColor Green
Write-Host ""
Write-Host "Now commit and push:" -ForegroundColor Cyan
Write-Host "git add prisma/generated"
Write-Host "git commit -m 'Add pre-generated Prisma client'"
Write-Host "Commit these files before deploying:" -ForegroundColor Cyan
Write-Host "git add lib/generated/prisma"
Write-Host "git commit -m 'Add generated Prisma client'"
Write-Host "git push"