-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscript.sh
More file actions
30 lines (21 loc) · 939 Bytes
/
script.sh
File metadata and controls
30 lines (21 loc) · 939 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#!/bin/bash
# Dieses Skript dient als robuster Entrypoint für den proffix-api Connector.
# Es wartet nur auf die Verfügbarkeit von Kafka.
# --- Variablen für Kafka ---
KAFKA_HOST=${KAFKA_HOST:-kafka:29092}
KAFKA_BROKER_HOST=$(echo "$KAFKA_HOST" | cut -d ':' -f 1)
KAFKA_BROKER_PORT=$(echo "$KAFKA_HOST" | cut -d ':' -f 2)
# --- AUF KAFKA WARTEN ---
echo "Warte darauf, dass Kafka unter $KAFKA_HOST bereit ist..."
# Korrigierte nc-Syntax für maximale Kompatibilität
while ! nc -w 1 -q 1 $KAFKA_BROKER_HOST $KAFKA_BROKER_PORT < /dev/null; do
echo "Kafka ist noch nicht erreichbar. Warte 1 Sekunde..."
sleep 1
done
echo "Kafka ist bereit."
# --- DIENSTE STARTEN ---
echo "Starte die Hintergrund- und Hauptdienste (keine DB-Verbindung nötig)..."
# Startet die Hintergrundaufgabe (z.B. Kafka-Processing)
python entrypoint.py > /dev/null 2>&1 &
# Starte den Hauptdienst im Vordergrund
exec flask run --host=0.0.0.0 --port=9500