| #!/bin/bash
|
|
|
|
|
|
|
|
|
| set -e
|
|
|
| echo "π Starting LMDpro deployment..."
|
|
|
|
|
| if [ ! -f ".env.production" ]; then
|
| echo "β Error: .env.production file not found!"
|
| echo "Please create .env.production with your production environment variables."
|
| exit 1
|
| fi
|
|
|
|
|
| echo "π¦ Installing dependencies..."
|
| npm ci --only=production
|
|
|
|
|
| echo "π Running type checks..."
|
| npm run typecheck
|
|
|
|
|
| echo "ποΈ Building application..."
|
| npm run build
|
|
|
|
|
| echo "π§ͺ Testing production build..."
|
| npm run start &
|
| BUILD_PID=$!
|
| sleep 10
|
|
|
|
|
| if curl -f http://localhost:3000 >/dev/null 2>&1; then
|
| echo "β
Production build test successful!"
|
| kill $BUILD_PID
|
| else
|
| echo "β Production build test failed!"
|
| kill $BUILD_PID
|
| exit 1
|
| fi
|
|
|
| echo "π Deployment preparation complete!"
|
| echo "π Next steps:"
|
| echo "1. Upload the .next folder and other files to your hosting provider"
|
| echo "2. Set up environment variables on your hosting platform"
|
| echo "3. Configure your custom domain DNS settings"
|
| echo "4. Start the production server with 'npm start'"
|
|
|