Files
digiserver/deploy-docker.sh
ske087 1eb0aa3658 feat: v1.1.0 - Production-Ready Docker Deployment
🚀 Major Release: DigiServer v1.1.0 Production Deployment

## 📁 Project Restructure
- Moved all application code to app/ directory for Docker containerization
- Centralized persistent data in data/ directory with volume mounting
- Removed development artifacts and cleaned up project structure

## 🐳 Docker Integration
- Added production-ready Dockerfile with LibreOffice and poppler-utils
- Updated docker-compose.yml for production deployment
- Added .dockerignore for optimized build context
- Created automated deployment script (deploy-docker.sh)
- Added cleanup script (cleanup-docker.sh)

## 📄 Document Processing Enhancements
- Integrated LibreOffice for professional PPTX to PDF conversion
- Implemented PPTX → PDF → 4K JPG workflow for optimal quality
- Added poppler-utils for enhanced PDF processing
- Simplified PDF conversion to 300 DPI for reliability

## 🔧 File Management Improvements
- Fixed absolute path resolution for containerized deployment
- Updated all file deletion functions with proper path handling
- Enhanced bulk delete functions for players and groups
- Improved file upload workflow with consistent path management

## 🛠️ Code Quality & Stability
- Cleaned up pptx_converter.py from 442 to 86 lines
- Removed all Python cache files (__pycache__/, *.pyc)
- Updated file operations for production reliability
- Enhanced error handling and logging

## 📚 Documentation Updates
- Updated README.md with Docker deployment instructions
- Added comprehensive DEPLOYMENT.md guide
- Included production deployment best practices
- Added automated deployment workflow documentation

## 🔐 Security & Production Features
- Environment-based configuration
- Health checks and container monitoring
- Automated admin user creation
- Volume-mounted persistent data
- Production logging and error handling

##  Ready for Production
- Clean project structure optimized for Docker
- Automated deployment with ./deploy-docker.sh
- Professional document processing pipeline
- Reliable file management system
- Complete documentation and deployment guides

Access: http://localhost:8880 | Admin: admin/Initial01!
2025-08-05 18:04:02 -04:00

110 lines
2.7 KiB
Bash
Executable File

#!/bin/bash
# DigiServer Docker Deployment Script
# Version: 1.1.0
set -e
echo "🚀 DigiServer Docker Deployment"
echo "================================"
# Colors for output
RED='\033[0;31m'
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
BLUE='\033[0;34m'
NC='\033[0m' # No Color
# Function to print colored output
print_status() {
echo -e "${BLUE}[INFO]${NC} $1"
}
print_success() {
echo -e "${GREEN}[SUCCESS]${NC} $1"
}
print_warning() {
echo -e "${YELLOW}[WARNING]${NC} $1"
}
print_error() {
echo -e "${RED}[ERROR]${NC} $1"
}
# Check if Docker is running
if ! docker info >/dev/null 2>&1; then
print_error "Docker is not running. Please start Docker and try again."
exit 1
fi
print_status "Docker is running ✓"
# Check if docker compose is available
if ! docker compose version >/dev/null 2>&1; then
print_error "docker compose is not available. Please install Docker Compose and try again."
exit 1
fi
print_status "docker compose is available ✓"
# Stop existing containers if running
print_status "Stopping existing containers..."
docker compose down 2>/dev/null || true
# Remove old images (optional)
read -p "Do you want to remove old DigiServer images? (y/N): " -n 1 -r
echo
if [[ $REPLY =~ ^[Yy]$ ]]; then
print_status "Removing old images..."
docker image prune -f --filter label=app=digiserver 2>/dev/null || true
docker rmi digiserver:latest 2>/dev/null || true
fi
# Create data directories if they don't exist
print_status "Creating data directories..."
mkdir -p data/instance data/uploads data/resurse
# Build the Docker image
print_status "Building DigiServer Docker image..."
docker compose build
# Check if build was successful
if [ $? -eq 0 ]; then
print_success "Docker image built successfully!"
else
print_error "Docker build failed!"
exit 1
fi
# Start the containers
print_status "Starting DigiServer containers..."
docker compose up -d
# Wait a moment for containers to start
sleep 10
# Check if containers are running
if docker compose ps | grep -q "Up"; then
print_success "DigiServer is now running!"
echo ""
echo "🌐 Access your DigiServer at: http://localhost:8880"
echo "📊 Admin Panel: http://localhost:8880/admin"
echo ""
echo "Default credentials:"
echo "Username: admin"
echo "Password: Initial01!"
echo ""
print_warning "Please change the default password after first login!"
echo ""
echo "📝 To view logs: docker compose logs -f"
echo "🛑 To stop: docker compose down"
echo "📊 To check status: docker compose ps"
else
print_error "Failed to start DigiServer containers!"
echo ""
echo "Check logs with: docker compose logs"
exit 1
fi
print_success "Deployment completed successfully! 🎉"