Refactor Docker setup and enhance MongoDB connection handling

- Updated Dockerfile to use Gunicorn for serving the Flask application instead of the default Python command.
- Modified docker-compose.yml to set memory limits and reservations for MongoDB and the web service.
- Enhanced main.py with improved MongoDB connection management using a thread-safe singleton pattern and added environment variable configurations for connection pooling.
- Introduced new utility functions for system monitoring, including uptime, load averages, and disk usage.
- Added backup and restore functionality for instances, including routes for exporting and importing backups.
- Removed the live monitor section from admin_instances.html and updated admin_system.html to include a comprehensive server management dashboard with KPIs and usage charts.
- Added a new gunicorn configuration file for better performance tuning.
- Updated requirements.txt to include Gunicorn as a dependency.
This commit is contained in:
2026-04-14 23:04:51 +02:00
parent 57e200b877
commit 83abe0aab9
7 changed files with 869 additions and 188 deletions
+12
View File
@@ -0,0 +1,12 @@
bind = "0.0.0.0:4999"
worker_class = "gthread"
workers = 1
threads = 8
timeout = 45
keepalive = 2
max_requests = 400
max_requests_jitter = 60
preload_app = False
accesslog = "-"
errorlog = "-"
loglevel = "warning"