115047ee
tangwang
为一个租户灌入测试数据;实例的启动...
|
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
#!/bin/bash
# Start Backend API Service
set -e
cd "$(dirname "$0")/.."
source /home/tw/miniconda3/etc/profile.d/conda.sh
conda activate searchengine
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m'
echo -e "${GREEN}========================================${NC}"
echo -e "${GREEN}Starting Backend API Service${NC}"
echo -e "${GREEN}========================================${NC}"
|
a406638e
tangwang
up
|
19
20
21
22
23
24
|
# Load config from .env file if it exists
if [ -f .env ]; then
set -a
source .env
set +a
fi
|
115047ee
tangwang
为一个租户灌入测试数据;实例的启动...
|
25
26
|
echo -e "\n${YELLOW}Configuration:${NC}"
|
a406638e
tangwang
up
|
27
28
29
30
|
echo " API Host: ${API_HOST:-0.0.0.0}"
echo " API Port: ${API_PORT:-6002}"
echo " ES Host: ${ES_HOST:-http://localhost:9200}"
echo " ES Username: ${ES_USERNAME:-not set}"
|
115047ee
tangwang
为一个租户灌入测试数据;实例的启动...
|
31
|
|
4d824a77
tangwang
所有租户共用一套统一配置.tena...
|
32
|
echo -e "\n${YELLOW}Starting service (multi-tenant)...${NC}"
|
a406638e
tangwang
up
|
33
34
|
# Export environment variables for the Python process
|
a406638e
tangwang
up
|
35
36
37
38
39
40
|
export API_HOST=${API_HOST:-0.0.0.0}
export API_PORT=${API_PORT:-6002}
export ES_HOST=${ES_HOST:-http://localhost:9200}
export ES_USERNAME=${ES_USERNAME:-}
export ES_PASSWORD=${ES_PASSWORD:-}
|
115047ee
tangwang
为一个租户灌入测试数据;实例的启动...
|
41
42
43
|
python -m api.app \
--host $API_HOST \
--port $API_PORT \
|
115047ee
tangwang
为一个租户灌入测试数据;实例的启动...
|
44
|
--es-host $ES_HOST
|