chore: reorganize project structure and prepare for deployment
- Organize files into logical directories (docs/, scripts/, tests/) - Add comprehensive documentation (README, CONTRIBUTING, CHANGELOG) - Create deployment automation scripts - Add Docker production configuration - Update .gitignore and add .dockerignore - Remove temporary and test files from root - Improve settings.py with DEBUG from env variable Added: - README.md with project overview - CONTRIBUTING.md for contributors - CHANGELOG.md for version tracking - PROJECT_STATUS.md with current state - docker-compose.prod.yml for production - nginx.conf for production web server - scripts/deploy.sh for automated deployment - scripts/check-config.sh for configuration validation - scripts/setup-ssl.sh for SSL certificate setup - docs/DEPLOYMENT.md with detailed deployment guide - docs/ENV_VARIABLES.md with all environment variables Moved: - Documentation to docs/ - Scripts to scripts/ - Test files to tests/ Removed: - .history/ directory - Test response JSON files from root - settings_production.py (merged into settings.py) This commit prepares the project for: - Production deployment - Team collaboration - Docker containerization - Proper documentation
This commit is contained in:
60
deploy.sh
60
deploy.sh
@@ -1,60 +0,0 @@
|
||||
#!/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"
|
||||
Reference in New Issue
Block a user