Files
BSN-Livesystem/deploy/README.md
T

1.5 KiB

BSN-Livesystem — Deploy-Anleitung

Installation des BSN-Livesystems als systemd-Dienste.

Voraussetzungen

  • Ubuntu/Debian Server mit systemd
  • Python 3.12+
  • Redis-Server (lokal oder remote)
  • Git

Installation

1. Repository klonen

git clone git@git.datenhimmel.work:danielkrause/BSN-Livesystem.git /opt/bsn-livesystem
cd /opt/bsn-livesystem

2. Virtual Environment erstellen

python3 -m venv venv
./venv/bin/pip install --upgrade pip
./venv/bin/pip install -e .

3. Umgebungsvariablen konfigurieren

cp .env .env.production
# .env.production mit echten Werten bearbeiten:
#   - REDIS_HOST=...
#   - WHATSAPP_APP_SECRET=...
#   - TELEGRAM_BOT_TOKEN=...

4. Services installieren

sudo cp deploy/bsn-chatbot.service /etc/systemd/system/
sudo cp deploy/bsn-worker.service /etc/systemd/system/
sudo systemctl daemon-reload

5. Services starten und aktivieren

sudo systemctl enable --now bsn-chatbot
sudo systemctl enable --now bsn-worker

6. Status prüfen

sudo systemctl status bsn-chatbot
sudo systemctl status bsn-worker
journalctl -u bsn-chatbot -f
journalctl -u bsn-worker -f

Services aktualisieren

cd /opt/bsn-livesystem
git pull
./venv/bin/pip install -e .
sudo systemctl restart bsn-chatbot bsn-worker

Health-Check

curl http://localhost:5002/health

Logs

journalctl -u bsn-chatbot --since "1 hour ago"
journalctl -u bsn-worker --since "1 hour ago"