From cdc957832faa78ce6dd42c6c31f713224ac50e00 Mon Sep 17 00:00:00 2001 From: sazzadulalambd Date: Mon, 22 Jun 2026 21:01:36 +0600 Subject: [PATCH] chore: update deployment script to support Next.js standalone mode for cPanel compatibility --- deploy.sh | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/deploy.sh b/deploy.sh index aed7317..9c9ef8c 100755 --- a/deploy.sh +++ b/deploy.sh @@ -5,16 +5,22 @@ echo "Building project..." npm run build # Create a deployment folder -echo "Preparing deployment files..." +echo "Preparing standalone deployment files for cPanel..." +rm -rf deploy mkdir -p deploy -cp -r .next deploy/ -cp -r public deploy/ -cp server.js deploy/ -cp package.json deploy/ -cp next.config.ts 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 and follow the guide." +echo "Done! Upload 'deploy.zip' to your cPanel directory, extract it, and point the Node.js app to 'server.js'."