chore: update ecosystem config to use virtualenv gunicorn path and adjust setup script execution

This commit is contained in:
bocil kematian 2026-06-23 00:06:51 +07:00
parent ee5e08ee66
commit fdf7928463
2 changed files with 11 additions and 10 deletions

View File

@ -2,9 +2,8 @@ module.exports = {
apps: [ apps: [
{ {
name: 'vsphere-backup-manager', name: 'vsphere-backup-manager',
// Gunicorn as the production WSGI server // Gunicorn inside the virtualenv as the production WSGI server
// If using a virtualenv, replace 'gunicorn' with './venv/bin/gunicorn' script: './venv/bin/gunicorn',
script: 'gunicorn',
args: [ args: [
'--workers', '4', '--workers', '4',
'--bind', '127.0.0.1:5000', '--bind', '127.0.0.1:5000',

View File

@ -18,15 +18,17 @@ echo "=========================================="
echo "" echo ""
# ── 1. Install system packages ──────────────────────────────────────────────── # ── 1. Install system packages ────────────────────────────────────────────────
echo "[1/6] Installing Nginx..." echo "[1/6] Installing Nginx and Python Venv..."
sudo -E apt update sudo -E apt update
sudo -E apt install -y nginx sudo -E apt install -y nginx python3-venv
# ── 2. Install Python packages ──────────────────────────────────────────────── # ── 2. Install Python packages in virtual environment ────────────────────────
echo "[2/6] Installing Python dependencies (including gunicorn)..." echo "[2/6] Setting up virtual environment and installing Python dependencies..."
# If you use a virtualenv, activate it first: if [ ! -d "$APP_DIR/venv" ]; then
# source ./venv/bin/activate python3 -m venv "$APP_DIR/venv"
pip install -r "$APP_DIR/requirements.txt" fi
"$APP_DIR/venv/bin/pip" install --upgrade pip
"$APP_DIR/venv/bin/pip" install -r "$APP_DIR/requirements.txt"
# ── 3. Generate self-signed SSL certificate (10-year validity) ──────────────── # ── 3. Generate self-signed SSL certificate (10-year validity) ────────────────
echo "[3/6] Generating self-signed TLS certificate (10 years)..." echo "[3/6] Generating self-signed TLS certificate (10 years)..."