2026-05-16 10:20:12 +06:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
|
|
# Build the project
|
|
|
|
|
echo "Building project..."
|
|
|
|
|
npm run build
|
|
|
|
|
|
|
|
|
|
# Create a deployment folder
|
2026-06-22 21:01:36 +06:00
|
|
|
echo "Preparing standalone deployment files for cPanel..."
|
|
|
|
|
rm -rf deploy
|
2026-05-16 10:20:12 +06:00
|
|
|
mkdir -p deploy
|
2026-06-22 21:01:36 +06:00
|
|
|
|
|
|
|
|
# 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
|
2026-05-16 10:20:12 +06:00
|
|
|
|
|
|
|
|
# Optional: Zip the files
|
|
|
|
|
echo "Zipping deployment files..."
|
|
|
|
|
cd deploy && zip -r ../deploy.zip . && cd ..
|
|
|
|
|
|
2026-06-22 21:01:36 +06:00
|
|
|
echo "Done! Upload 'deploy.zip' to your cPanel directory, extract it, and point the Node.js app to 'server.js'."
|