chore: update deployment script to support Next.js standalone mode for cPanel compatibility
This commit is contained in:
20
deploy.sh
20
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'."
|
||||
|
||||
Reference in New Issue
Block a user