Add Docker support and improve PDF conversion
Features: - Dockerfile for containerized deployment - Docker Compose configuration with health checks - Automated database initialization via entrypoint script - Quick start script for easy Docker deployment - Comprehensive Docker deployment documentation (DOCKER.md) - Complete README with installation and usage instructions - .dockerignore for optimized image builds Improvements: - PDF conversion now preserves orientation (portrait/landscape) - PDF rendering at 300 DPI for sharp quality - Maintains aspect ratio during conversion - Compact media library view with image thumbnails - Better media preview with scrollable gallery Docker Features: - Multi-stage build for smaller images - Non-root user for security - Health checks for container monitoring - Volume mounts for persistent data - Production-ready Gunicorn configuration - Support for Redis caching (optional)
This commit is contained in:
69
docker-start.sh
Executable file
69
docker-start.sh
Executable file
@@ -0,0 +1,69 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo "🚀 DigiServer v2 - Docker Quick Start"
|
||||
echo "====================================="
|
||||
echo ""
|
||||
|
||||
# Check if Docker is installed
|
||||
if ! command -v docker &> /dev/null; then
|
||||
echo "❌ Docker is not installed. Please install Docker first."
|
||||
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 first."
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Create .env file if it doesn't exist
|
||||
if [ ! -f .env ]; then
|
||||
echo "📝 Creating .env file..."
|
||||
cp .env.example .env
|
||||
|
||||
# Generate random secret key
|
||||
SECRET_KEY=$(openssl rand -base64 32)
|
||||
sed -i "s/change-this-to-a-random-secret-key/$SECRET_KEY/" .env
|
||||
echo "✅ Created .env with generated SECRET_KEY"
|
||||
fi
|
||||
|
||||
# Create required directories
|
||||
echo "📁 Creating required directories..."
|
||||
mkdir -p instance app/static/uploads
|
||||
echo "✅ Directories created"
|
||||
|
||||
echo ""
|
||||
echo "🔨 Building Docker image..."
|
||||
docker-compose build
|
||||
|
||||
echo ""
|
||||
echo "🚀 Starting DigiServer v2..."
|
||||
docker-compose up -d
|
||||
|
||||
echo ""
|
||||
echo "⏳ Waiting for application to start..."
|
||||
sleep 5
|
||||
|
||||
# Check if container is running
|
||||
if docker-compose ps | grep -q "Up"; then
|
||||
echo ""
|
||||
echo "✅ DigiServer v2 is running!"
|
||||
echo ""
|
||||
echo "📍 Access the application at: http://localhost:5000"
|
||||
echo ""
|
||||
echo "👤 Default credentials:"
|
||||
echo " Username: admin"
|
||||
echo " Password: admin123"
|
||||
echo ""
|
||||
echo "📋 Useful commands:"
|
||||
echo " View logs: docker-compose logs -f"
|
||||
echo " Stop: docker-compose down"
|
||||
echo " Restart: docker-compose restart"
|
||||
echo " Shell access: docker-compose exec digiserver bash"
|
||||
echo ""
|
||||
echo "⚠️ IMPORTANT: Change the admin password after first login!"
|
||||
else
|
||||
echo ""
|
||||
echo "❌ Failed to start DigiServer v2"
|
||||
echo " Check logs with: docker-compose logs"
|
||||
fi
|
||||
Reference in New Issue
Block a user