Fix Docker deploy Prisma build
This commit is contained in:
@@ -1,28 +1,19 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Copying Prisma generated files..."
|
||||
echo "Generating Prisma client for deployment..."
|
||||
|
||||
# ساخت پوشه
|
||||
mkdir -p prisma/generated
|
||||
npx prisma generate
|
||||
|
||||
# بررسی وجود فایلها
|
||||
if [ ! -d "node_modules/.prisma/client" ]; then
|
||||
echo "Error: Prisma client not found!"
|
||||
echo "Please run: npm install && npx prisma generate"
|
||||
if [ ! -f "lib/generated/prisma/index.js" ]; then
|
||||
echo "Error: lib/generated/prisma/index.js was not created."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# کپی کردن
|
||||
echo "Copying .prisma/client..."
|
||||
cp -r node_modules/.prisma/client prisma/generated/.prisma-client
|
||||
|
||||
echo "Copying @prisma/client..."
|
||||
cp -r node_modules/@prisma/client prisma/generated/@prisma-client
|
||||
|
||||
echo ""
|
||||
echo "✓ Files copied successfully!"
|
||||
echo "Prisma client generated successfully."
|
||||
echo ""
|
||||
echo "Now commit and push:"
|
||||
echo "git add prisma/generated"
|
||||
echo "git commit -m 'Add pre-generated Prisma client'"
|
||||
echo "Commit these files before deploying:"
|
||||
echo "git add lib/generated/prisma"
|
||||
echo "git commit -m 'Add generated Prisma client'"
|
||||
echo "git push"
|
||||
|
||||
Reference in New Issue
Block a user