init commit

This commit is contained in:
2025-11-24 07:02:33 +09:00
commit 7bf003e70d
488 changed files with 51130 additions and 0 deletions

60
deploy.sh Normal file
View File

@@ -0,0 +1,60 @@
#!/bin/bash
# Production deployment script for SmartSolTech
set -e
echo "🚀 Starting SmartSolTech deployment..."
# Check if .env file exists
if [ ! -f .env ]; then
echo "⚠️ .env file not found!"
echo "Creating .env from .env.example..."
cp .env.example .env
echo "📝 Please edit .env file with your production values before continuing."
exit 1
fi
# Stop existing containers
echo "🛑 Stopping existing containers..."
docker-compose down
# Build images
echo "🏗️ Building Docker images..."
docker-compose build --no-cache
# Start services
echo "▶️ Starting services..."
docker-compose up -d postgres_db
# Wait for database to be ready
echo "⏳ Waiting for database to be ready..."
sleep 10
# Run migrations
echo "🔄 Running database migrations..."
docker-compose run --rm web python smartsoltech/manage.py migrate
# Collect static files
echo "📦 Collecting static files..."
docker-compose run --rm web python smartsoltech/manage.py collectstatic --noinput
# Create superuser (optional, commented out for security)
# echo "👤 Creating superuser..."
# docker-compose run --rm web python smartsoltech/manage.py createsuperuser
# Start all services
echo "🎬 Starting all services..."
docker-compose up -d
# Show running containers
echo "✅ Deployment complete! Running containers:"
docker-compose ps
echo ""
echo "📋 Service URLs:"
echo " Django App: http://localhost:8000"
echo " PgAdmin: http://localhost:8080"
echo ""
echo "📝 To view logs: docker-compose logs -f"
echo "🛑 To stop: docker-compose down"