main
This commit is contained in:
@@ -0,0 +1,58 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "🚀 Starting University Portal deployment..."
|
||||
|
||||
# Check if Docker is installed
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "❌ Docker is not installed. Please install Docker and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if Docker Compose is installed
|
||||
if ! command -v docker-compose &> /dev/null; then
|
||||
echo "❌ Docker Compose is not installed. Please install Docker Compose and try again."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if .env.local exists
|
||||
if [ ! -f .env.local ]; then
|
||||
echo "❌ .env.local file not found. Please copy .env.example to .env.local and configure it."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Load environment variables
|
||||
source .env.local
|
||||
|
||||
# Create uploads directory if it doesn't exist
|
||||
mkdir -p uploads
|
||||
|
||||
# Build and start containers
|
||||
echo "🏗️ Building and starting containers..."
|
||||
docker-compose up --build -d
|
||||
|
||||
# Wait for PostgreSQL to be ready
|
||||
echo "⏳ Waiting for PostgreSQL to be ready..."
|
||||
sleep 10
|
||||
|
||||
# Run database migrations
|
||||
echo "🔄 Running database migrations..."
|
||||
docker-compose exec app npx prisma migrate deploy
|
||||
|
||||
# Seed the database
|
||||
echo "🌱 Seeding database with demo data..."
|
||||
docker-compose exec app npx prisma db seed
|
||||
|
||||
echo "✅ Deployment complete!"
|
||||
echo ""
|
||||
echo "🌐 Application is running at: http://localhost:3000"
|
||||
echo "📊 Grafana dashboard at: http://localhost:3001 (admin/admin)"
|
||||
echo "🗄️ PostgreSQL is running on: localhost:5432"
|
||||
echo "💾 Redis is running on: localhost:6379"
|
||||
echo ""
|
||||
echo "Demo accounts:"
|
||||
echo "- Student: student@university.edu / password123"
|
||||
echo "- Admin: admin@university.edu / admin123"
|
||||
echo ""
|
||||
echo "To stop the application, run: docker-compose down"
|
||||
echo "To view logs, run: docker-compose logs -f"
|
||||
Reference in New Issue
Block a user