fix: use host network for rag service container (#1649)
This commit is contained in:
2
Makefile
2
Makefile
@@ -17,7 +17,7 @@ BUILD_DIR := build
|
||||
BUILD_FROM_SOURCE ?= false
|
||||
TARGET_LIBRARY ?= all
|
||||
|
||||
RAG_SERVICE_VERSION ?= 0.0.8
|
||||
RAG_SERVICE_VERSION ?= 0.0.9
|
||||
RAG_SERVICE_IMAGE := quay.io/yetoneful/avante-rag-service:$(RAG_SERVICE_VERSION)
|
||||
|
||||
all: luajit
|
||||
|
||||
@@ -8,7 +8,7 @@ local M = {}
|
||||
local container_name = "avante-rag-service"
|
||||
local service_path = "/tmp/" .. container_name
|
||||
|
||||
function M.get_rag_service_image() return "quay.io/yetoneful/avante-rag-service:0.0.8" end
|
||||
function M.get_rag_service_image() return "quay.io/yetoneful/avante-rag-service:0.0.9" end
|
||||
|
||||
function M.get_rag_service_port() return 20250 end
|
||||
|
||||
@@ -74,8 +74,7 @@ function M.launch_rag_service(cb)
|
||||
M.stop_rag_service()
|
||||
end
|
||||
local cmd_ = string.format(
|
||||
"docker run -d -p %d:8000 --name %s -v %s:/data -v %s:/host:ro -e ALLOW_RESET=TRUE -e DATA_DIR=/data -e RAG_PROVIDER=%s -e %s_API_KEY=%s -e %s_API_BASE=%s -e RAG_LLM_MODEL=%s -e RAG_EMBED_MODEL=%s %s %s",
|
||||
port,
|
||||
"docker run -d --network=host --name %s -v %s:/data -v %s:/host:ro -e ALLOW_RESET=TRUE -e DATA_DIR=/data -e RAG_PROVIDER=%s -e %s_API_KEY=%s -e %s_API_BASE=%s -e RAG_LLM_MODEL=%s -e RAG_EMBED_MODEL=%s %s %s",
|
||||
container_name,
|
||||
data_path,
|
||||
Config.rag_service.host_mount,
|
||||
|
||||
@@ -15,11 +15,8 @@ RUN uv venv
|
||||
RUN uv pip install -r requirements.txt
|
||||
|
||||
ENV PYTHONUNBUFFERED=1 \
|
||||
PYTHONDONTWRITEBYTECODE=1 \
|
||||
PORT=8000
|
||||
|
||||
EXPOSE ${PORT}
|
||||
PYTHONDONTWRITEBYTECODE=1
|
||||
|
||||
COPY . .
|
||||
|
||||
CMD ["uv", "run", "fastapi", "run", "src/main.py", "--workers", "3"]
|
||||
CMD ["uv", "run", "fastapi", "run", "src/main.py", "--workers", "3", "--port", "20250"]
|
||||
|
||||
Reference in New Issue
Block a user