forked from FalkorDB/QueryWeaver
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
30 lines (22 loc) · 913 Bytes
/
start.sh
File metadata and controls
30 lines (22 loc) · 913 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
set -e
# Set default values if not set
FALKORDB_HOST="${FALKORDB_HOST:-localhost}"
FALKORDB_PORT="${FALKORDB_PORT:-6379}"
# Start FalkorDB Redis server in background
redis-server --loadmodule /var/lib/falkordb/bin/falkordb.so | cat &
# Wait until FalkorDB is ready
echo "Waiting for FalkorDB to start on $FALKORDB_HOST:$FALKORDB_PORT..."
while ! nc -z "$FALKORDB_HOST" "$FALKORDB_PORT"; do
sleep 0.5
done
echo "FalkorDB is up - launching FastAPI..."
# Determine whether to run in reload (debug) mode. The project uses FASTAPI_DEBUG
# environment variable historically; keep compatibility by honoring it here.
if [ "${FASTAPI_DEBUG:-False}" = "True" ] || [ "${FASTAPI_DEBUG:-true}" = "true" ]; then
RELOAD_FLAG="--reload"
else
RELOAD_FLAG=""
fi
echo "FalkorDB is up - launching FastAPI (uvicorn)..."
exec uvicorn api.index:app --host "${HOST:-0.0.0.0}" --port "${PORT:-5000}" $RELOAD_FLAG