homework-jianmu/packaging/docker/entrypoint.sh

43 lines
1.0 KiB
Bash
Executable File

#!/bin/bash
export PATH="/usr/local/taos/taosanode/venv/bin:$PATH"
export LANG=en_US.UTF-8
export LC_CTYPE=en_US.UTF-8
export LC_ALL=en_US.UTF-8
CONFIG_FILE="/usr/local/taos/taosanode/cfg/taosanode.ini"
TS_SERVER_FILE="/apps/taos_ts_server.py"
TIMER_POE_FILE="/apps/timer-moe/timer-moe_server.py"
if [ ! -f "$CONFIG_FILE" ]; then
echo "Error: Configuration file $CONFIG_FILE not found!"
exit 1
fi
echo "Starting tdtsfm server..."
python3 $TS_SERVER_FILE --action server &
TAOS_TS_PID=$!
if ! ps -p $TAOS_TS_PID > /dev/null; then
echo "Error: tdtsfm server failed to start!"
exit 1
fi
# echo "Starting timer-moe server..."
# cd /apps/timer-moe
# python3 $TIMER_POE_FILE --action server &
# TIMER_MOE_PID=$!
# if ! ps -p $TIMER_MOE_PID > /dev/null; then
# echo "Error: timer-moe server failed to start!"
# exit 1
# fi
echo "Starting uWSGI with config: $CONFIG_FILE"
exec /usr/local/taos/taosanode/venv/bin/uwsgi --ini "$CONFIG_FILE"
if [ $? -ne 0 ]; then
echo "uWSGI failed to start. Exiting..."
exit 1
fi