feat: add convenience functions, update Docker setup, and integrate Webpack for building WebRTC internals exporter
Some checks failed
Build Docker Image for Pull Request / build (pull_request) Failing after 35s

This commit is contained in:
2025-02-19 21:56:14 +01:00
parent 84479c786a
commit b05d7ca127
17 changed files with 9691 additions and 39 deletions

48
monolith-entrypoint.sh Normal file
View File

@@ -0,0 +1,48 @@
#!/bin/bash
if [ -z "$TELEGRAF_HOSTNAME" ]; then
echo "Error: TELEGRAF_HOSTNAME is not set"
exit 1
fi
if [ -z "$TELEGRAF_MONGODB_DSN" ]; then
echo "Error: TELEGRAF_MONGODB_DSN is not set"
exit 1
fi
if [ -z "$TELEGRAF_MONGODB_DATABASE" ]; then
echo "Error: TELEGRAF_MONGODB_DATABASE is not set"
exit 1
fi
if [ -z "$VIDEO_URL" ]; then
echo "Error: VIDEO_URL is not set"
exit 1
fi
# Set the environment variables
export DSN=$TELEGRAF_MONGODB_DSN
export DATABASE=$TELEGRAF_MONGODB_DATABASE
export HOSTNAME=$TELEGRAF_HOSTNAME
# Start the Selenium hub
/opt/bin/entry_point.sh > /dev/null 2>&1 &
# Wait for Selenium hub to be ready
printf 'Waiting for Selenium standalone to be ready'
timeout=30
while ! curl -sSL "http://localhost:4444/wd/hub/status" 2>/dev/null | jq -e '.value.ready' | grep -q true; do
printf '.'
sleep 1
((timeout--))
if [ $timeout -le 0 ]; then
echo "Error: Selenium standalone did not become ready in time. Exiting..."
exit 1
fi
done
printf '\n'
# Start the Telegraf agent and the main script
telegraf --config ./telegraf.conf &
./venv/bin/python main.py