83abe0aab9
- 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.
56 lines
2.0 KiB
YAML
56 lines
2.0 KiB
YAML
services:
|
|
mongodb:
|
|
image: mongo:7
|
|
restart: unless-stopped
|
|
mem_limit: 512m
|
|
mem_reservation: 256m
|
|
environment:
|
|
MONGO_INITDB_DATABASE: Invario_Website
|
|
volumes:
|
|
- mongo_data:/data/db
|
|
healthcheck:
|
|
test: ["CMD", "mongosh", "--quiet", "--eval", "db.adminCommand('ping').ok"]
|
|
interval: 10s
|
|
timeout: 5s
|
|
retries: 8
|
|
|
|
website:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
restart: unless-stopped
|
|
depends_on:
|
|
mongodb:
|
|
condition: service_healthy
|
|
environment:
|
|
MONGO_URI: mongodb://mongodb:27017
|
|
MONGO_DB_NAME: Invario_Website
|
|
MONGO_MAX_POOL_SIZE: ${MONGO_MAX_POOL_SIZE:-24}
|
|
MONGO_MIN_POOL_SIZE: ${MONGO_MIN_POOL_SIZE:-0}
|
|
MONGO_MAX_IDLE_MS: ${MONGO_MAX_IDLE_MS:-60000}
|
|
MONGO_CONNECT_TIMEOUT_MS: ${MONGO_CONNECT_TIMEOUT_MS:-1500}
|
|
MONGO_SOCKET_TIMEOUT_MS: ${MONGO_SOCKET_TIMEOUT_MS:-30000}
|
|
MONGO_WAIT_QUEUE_TIMEOUT_MS: ${MONGO_WAIT_QUEUE_TIMEOUT_MS:-2000}
|
|
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-0}
|
|
JWT_SECRET_KEY: change-this-in-production
|
|
INSTANCE_PROVISION_SCRIPT: /app/provision_instance.sh
|
|
INSTANCE_BASE_DIR: /opt/inventarsystem-instances
|
|
INSTANCE_PARENT_DOMAIN: ${INSTANCE_PARENT_DOMAIN:-meine-domain}
|
|
INSTANCE_REPO_URL: ${INSTANCE_REPO_URL:-https://github.com/AIIrondev/legendary-octo-garbanzo}
|
|
INSTANCE_TLS_MODE: ${INSTANCE_TLS_MODE:-development}
|
|
INSTANCE_WILDCARD_CERT_FILE: ${INSTANCE_WILDCARD_CERT_FILE:-/etc/nginx/certs/wildcard.meine-domain.crt}
|
|
INSTANCE_WILDCARD_KEY_FILE: ${INSTANCE_WILDCARD_KEY_FILE:-/etc/nginx/certs/wildcard.meine-domain.key}
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /opt/inventarsystem-instances:/opt/inventarsystem-instances
|
|
- /etc/nginx/sites-available:/etc/nginx/sites-available
|
|
- /etc/nginx/sites-enabled:/etc/nginx/sites-enabled
|
|
- /etc/nginx/certs:/etc/nginx/certs
|
|
ports:
|
|
- "4999:4999"
|
|
mem_limit: 384m
|
|
mem_reservation: 192m
|
|
|
|
volumes:
|
|
mongo_data:
|