ragflow/docker/entrypoint.sh

36 lines
759 B
Bash
Raw Normal View History

#!/bin/bash
# replace env variables in the service_conf.yaml file
rm -rf /ragflow/conf/service_conf.yaml
while IFS= read -r line || [[ -n "$line" ]]; do
# Use eval to interpret the variable with default values
eval "echo \"$line\"" >> /ragflow/conf/service_conf.yaml
done < /ragflow/conf/service_conf.yaml.template
2024-02-28 18:57:43 +08:00
/usr/sbin/nginx
export LD_LIBRARY_PATH=/usr/lib/x86_64-linux-gnu/
PY=python3
if [[ -z "$WS" || $WS -lt 1 ]]; then
WS=1
fi
2024-02-28 18:57:43 +08:00
function task_exe(){
JEMALLOC_PATH=$(pkg-config --variable=libdir jemalloc)/libjemalloc.so
2024-03-06 19:16:31 +08:00
while [ 1 -eq 1 ];do
LD_PRELOAD=$JEMALLOC_PATH $PY rag/svr/task_executor.py $1;
2024-03-06 19:16:31 +08:00
done
}
2024-03-06 19:16:31 +08:00
for ((i=0;i<WS;i++))
do
task_exe $i &
2024-03-06 19:16:31 +08:00
done
while [ 1 -eq 1 ];do
$PY api/ragflow_server.py
done
wait;