we can now build a docker container from it
This commit is contained in:
40
entrypoint.sh
Executable file
40
entrypoint.sh
Executable file
@@ -0,0 +1,40 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
echo "Starting Room Cleaning Tracker..."
|
||||
|
||||
# Start the POST logger in background
|
||||
python starface_call_logger.py &
|
||||
LOGGER_PID=$!
|
||||
|
||||
# Start the dashboard in background
|
||||
python dashboard.py &
|
||||
DASHBOARD_PID=$!
|
||||
|
||||
# Function to kill both on exit
|
||||
cleanup() {
|
||||
echo "Shutting down..."
|
||||
kill $LOGGER_PID $DASHBOARD_PID 2>/dev/null || true
|
||||
exit 1
|
||||
}
|
||||
|
||||
trap cleanup SIGTERM SIGINT
|
||||
|
||||
# Monitor both processes
|
||||
while true; do
|
||||
# Check if logger is still running
|
||||
if ! kill -0 $LOGGER_PID 2>/dev/null; then
|
||||
echo "ERROR: Logger crashed!"
|
||||
kill $DASHBOARD_PID 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if dashboard is still running
|
||||
if ! kill -0 $DASHBOARD_PID 2>/dev/null; then
|
||||
echo "ERROR: Dashboard crashed!"
|
||||
kill $LOGGER_PID 2>/dev/null || true
|
||||
exit 1
|
||||
fi
|
||||
|
||||
sleep 2
|
||||
done
|
||||
Reference in New Issue
Block a user