#!/bin/bash # Build the project echo "Building project..." npm run build # Create a deployment folder echo "Preparing standalone deployment files for cPanel..." rm -rf deploy mkdir -p deploy # Copy standalone output which includes the minimal server.js and node_modules cp -r .next/standalone/* deploy/ # Copy public assets cp -r public deploy/public # Copy static assets (required by standalone server) mkdir -p deploy/.next cp -r .next/static deploy/.next/static # Optional: Zip the files echo "Zipping deployment files..." cd deploy && zip -r ../deploy.zip . && cd .. echo "Done! Upload 'deploy.zip' to your cPanel directory, extract it, and point the Node.js app to 'server.js'."