84 lines
1.5 KiB
Markdown
84 lines
1.5 KiB
Markdown
# 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
|
|
|
|
```bash
|
|
git clone git@git.datenhimmel.work:danielkrause/BSN-Livesystem.git /opt/bsn-livesystem
|
|
cd /opt/bsn-livesystem
|
|
```
|
|
|
|
### 2. Virtual Environment erstellen
|
|
|
|
```bash
|
|
python3 -m venv venv
|
|
./venv/bin/pip install --upgrade pip
|
|
./venv/bin/pip install -e .
|
|
```
|
|
|
|
### 3. Umgebungsvariablen konfigurieren
|
|
|
|
```bash
|
|
cp .env .env.production
|
|
# .env.production mit echten Werten bearbeiten:
|
|
# - REDIS_HOST=...
|
|
# - WHATSAPP_APP_SECRET=...
|
|
# - TELEGRAM_BOT_TOKEN=...
|
|
```
|
|
|
|
### 4. Services installieren
|
|
|
|
```bash
|
|
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
|
|
|
|
```bash
|
|
sudo systemctl enable --now bsn-chatbot
|
|
sudo systemctl enable --now bsn-worker
|
|
```
|
|
|
|
### 6. Status prüfen
|
|
|
|
```bash
|
|
sudo systemctl status bsn-chatbot
|
|
sudo systemctl status bsn-worker
|
|
journalctl -u bsn-chatbot -f
|
|
journalctl -u bsn-worker -f
|
|
```
|
|
|
|
## Services aktualisieren
|
|
|
|
```bash
|
|
cd /opt/bsn-livesystem
|
|
git pull
|
|
./venv/bin/pip install -e .
|
|
sudo systemctl restart bsn-chatbot bsn-worker
|
|
```
|
|
|
|
## Health-Check
|
|
|
|
```bash
|
|
curl http://localhost:5002/health
|
|
```
|
|
|
|
## Logs
|
|
|
|
```bash
|
|
journalctl -u bsn-chatbot --since "1 hour ago"
|
|
journalctl -u bsn-worker --since "1 hour ago"
|
|
```
|