[Unit] Description=ZMB Webui Backend API After=network.target Wants=network-online.target [Service] Type=notify User=root WorkingDirectory=/opt/zmb-webui/backend Environment="PYTHONUNBUFFERED=1" Environment="PYTHONDONTWRITEBYTECODE=1" # Start command with gunicorn ExecStart=/usr/bin/python3 -m uvicorn main:app \ --host 0.0.0.0 \ --port 8000 \ --workers 2 \ --worker-class uvicorn.workers.UvicornWorker \ --timeout 30 \ --access-logfile - # Process management Restart=always RestartSec=10 KillSignal=SIGTERM KillMode=process # Resource limits MemoryLimit=512M MemoryMax=768M CPUQuota=75% # Logging StandardOutput=journal StandardError=journal SyslogIdentifier=zmb-webui-backend # Security NoNewPrivileges=true ProtectSystem=strict ProtectHome=yes PrivateTmp=yes ReadWritePaths=/opt/zmb-webui/backend/config [Install] WantedBy=multi-user.target