- Introduced new authentication settings in config.py including `auth_enabled`, `admin_username`, `admin_password`, and `session_secret`. - Added validation for `session_secret` to ensure it meets security requirements when authentication is enabled. - Updated main.py to conditionally mount static files and log warnings if the directory is not found. - Removed unused email template files and added new authentication and notification setup documentation. - Implemented authentication configuration validation in validators.py and updated settings display. - Enhanced the user interface with a new login template and SVG assets for branding. - Added comprehensive guides for setting up authentication and notifications in the documentation.
3.3 KiB
Deployment Guide
This guide provides instructions for deploying DocuElevate in various environments.
Prerequisites
- Docker and Docker Compose
- Access to required external services (if configured):
- OpenAI API
- Azure Document Intelligence
- Dropbox API
- Nextcloud instance
- Paperless NGX instance
- SMTP server (for email notifications)
- IMAP server(s) (for email attachment processing)
- Notification services (Discord, Telegram, etc. for system alerts)
Docker Deployment
Docker is the recommended deployment method for DocuElevate.
Step 1: Clone the Repository
git clone https://github.com/christianlouis/document-processor.git
cd document-processor
Step 2: Configure Environment Variables
Create a .env file based on the example:
cp .env.example .env
Edit the .env file with your configuration settings. See the Configuration Guide for details.
Step 3: Run with Docker Compose
docker-compose up -d
This will start:
- The DocuElevate API server
- A worker for background tasks
- Redis for message broker and result storage
- Gotenberg for PDF processing
Step 4: Verify the Installation
Access the web interface at http://localhost:8000 and the API documentation at http://localhost:8000/docs.
Production Considerations
Reverse Proxy Setup
For production use, we recommend setting up a reverse proxy (like Nginx or Traefik) to handle HTTPS and domain routing:
server {
listen 80;
server_name docuelevate.example.com;
location / {
proxy_pass http://localhost:8000;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
Persistent Storage
The Docker setup uses volumes for persistent storage. For production, consider:
volumes:
- /path/to/persistent/storage:/workdir
Security
- Always use HTTPS in production
- Enable authentication by setting
AUTH_ENABLED=true - Use strong passwords for all services
- Limit access to the Docker host
- Regularly update the application and dependencies
Scaling
For high-volume deployments:
- Increase worker processes by adding more worker containers:
worker:
image: christianlouis/document-processor:latest
deploy:
replicas: 3
- Consider using dedicated Redis and database servers
- Monitor system performance and adjust resources as needed
Monitoring
Monitor your DocuElevate deployment using:
- Docker's built-in logging:
docker-compose logs -f - Container metrics:
docker stats - External monitoring tools like Prometheus and Grafana
Backup Procedures
Regularly back up the following:
- The
/workdirdirectory containing all processed documents - The database file (if using SQLite) or database contents (if using another DBMS)
- The
.envconfiguration file
Updates
To update DocuElevate to a newer version:
# Pull the latest changes
git pull
# Pull the latest Docker images
docker-compose pull
# Restart the services
docker-compose down
docker-compose up -d
Troubleshooting
See the Troubleshooting guide for common deployment issues and solutions.