- Add .env.production with correct API URL for live server - Add deploy.sh script for easy deployment - Fix frontend to use https://tilbudsgiveren.alw.dk for production API calls - Rebuild frontend with correct environment variables
45 lines
881 B
Bash
Executable File
45 lines
881 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Deploy script for tilbudsgiveren.alw.dk
|
|
# This script builds frontend and restarts the PM2 services
|
|
|
|
echo "🚀 Deploying Tilbudsgiveren..."
|
|
|
|
# Navigate to project root
|
|
cd /home/alex/git/tilbudgivern
|
|
|
|
# Pull latest changes (if using git)
|
|
echo "📥 Pulling latest changes..."
|
|
git pull origin main
|
|
|
|
# Install/update dependencies
|
|
echo "📦 Installing dependencies..."
|
|
npm install
|
|
|
|
# Backend dependencies
|
|
cd backend
|
|
npm install
|
|
cd ..
|
|
|
|
# Frontend dependencies and build
|
|
echo "🏗️ Building frontend..."
|
|
cd frontend
|
|
npm install
|
|
npm run build
|
|
cd ..
|
|
|
|
# Restart PM2 services
|
|
echo "🔄 Restarting services..."
|
|
pm2 restart tilbudgivern-unified
|
|
|
|
# Show status
|
|
echo "✅ Deployment complete!"
|
|
pm2 status
|
|
|
|
echo ""
|
|
echo "🌐 Application is available at:"
|
|
echo " https://tilbudsgiveren.alw.dk"
|
|
echo ""
|
|
echo "🔍 Monitor logs with:"
|
|
echo " pm2 logs tilbudgivern-unified"
|