Skip to content

Open-source LLM knowledge platform: turn raw documents into a queryable RAG, an autonomous reasoning agent, and a self-maintaining Wiki.

feat: support modify listening port

wizardchenfd6c50059e55
diff --git a/.env.example b/.env.example
index 3602409b5..e3a44d055 100644
--- a/.env.example
+++ b/.env.example
@@ -27,6 +27,15 @@ STREAM_MANAGER_TYPE=redis
# 数据库端口,默认为5432
DB_PORT=5432
+# 应用服务端口,默认为8080
+APP_PORT=8080
+
+# 前端服务端口,默认为80
+FRONTEND_PORT=80
+
+# 文档解析模块端口,默认为50051
+DOCREADER_PORT=50051
+
# 数据库用户名
DB_USER=postgres
diff --git a/docker-compose.yml b/docker-compose.yml
index be99ac410..9af3f4135 100644
--- a/docker-compose.yml
+++ b/docker-compose.yml
@@ -3,7 +3,7 @@ services:
image: wechatopenai/weknora-app:latest
container_name: WeKnora-app
ports:
- - "8080:8080"
+ - "${APP_PORT:-8080}:8080"
volumes:
- data-files:/data/files
- ./config/config.yaml:/app/config/config.yaml
@@ -98,7 +98,7 @@ services:
image: wechatopenai/weknora-ui:latest
container_name: WeKnora-frontend
ports:
- - "80:80"
+ - "${FRONTEND_PORT:-80}:80"
depends_on:
- app
networks:
@@ -109,7 +109,7 @@ services:
image: wechatopenai/weknora-docreader:latest
container_name: WeKnora-docreader
ports:
- - "50051:50051"
+ - "${DOCREADER_PORT:-50051}:50051"
environment:
- COS_SECRET_ID=${COS_SECRET_ID}
- COS_SECRET_KEY=${COS_SECRET_KEY}
diff --git a/scripts/start_all.sh b/scripts/start_all.sh
index d43046564..3e0afa336 100755
--- a/scripts/start_all.sh
+++ b/scripts/start_all.sh
@@ -703,8 +703,8 @@ else
if [ "$START_OLLAMA" = true ] && [ "$START_DOCKER" = true ]; then
if [ $OLLAMA_RESULT -eq 0 ] && [ $DOCKER_RESULT -eq 0 ]; then
log_success "所有服务启动完成,可通过以下地址访问:"
- echo -e "${GREEN} - 前端界面: http://localhost${NC}"
- echo -e "${GREEN} - API接口: http://localhost:8080${NC}"
+ echo -e "${GREEN} - 前端界面: http://localhost:${FRONTEND_PORT:-80}${NC}"
+ echo -e "${GREEN} - API接口: http://localhost:${APP_PORT:-8080}${NC}"
echo -e "${GREEN} - Jaeger链路追踪: http://localhost:16686${NC}"
else
log_error "部分服务启动失败,请检查日志并修复问题"
@@ -714,8 +714,8 @@ else
echo -e "${GREEN} - Ollama API: http://localhost:$OLLAMA_PORT${NC}"
elif [ "$START_DOCKER" = true ] && [ $DOCKER_RESULT -eq 0 ]; then
log_success "Docker容器启动完成,可通过以下地址访问:"
- echo -e "${GREEN} - 前端界面: http://localhost${NC}"
- echo -e "${GREEN} - API接口: http://localhost:8080${NC}"
+ echo -e "${GREEN} - 前端界面: http://localhost:${FRONTEND_PORT:-80}${NC}"
+ echo -e "${GREEN} - API接口: http://localhost:${APP_PORT:-8080}${NC}"
echo -e "${GREEN} - Jaeger链路追踪: http://localhost:16686${NC}"
fi
fi