diff --git a/docker-compose.yml b/docker-compose.yml index 26bd8fb..b605985 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -6,6 +6,10 @@ services: depends_on: postgres: condition: service_healthy + onlyoffice: + condition: service_healthy + qdrant: + condition: service_healthy environment: WEB_HOST: 0.0.0.0 WEB_PORT: "${WEB_PORT:-5173}" @@ -13,18 +17,18 @@ services: SERVER_PORT: "${SERVER_PORT:-8000}" SERVER_RELOAD: "${SERVER_RELOAD:-true}" SERVER_VENV_DIR: /tmp/x-financial-server-venv - X_FINANCIAL_PREFER_ENV_FILE: "true" + X_FINANCIAL_PREFER_ENV_FILE: "false" POSTGRES_HOST: postgres POSTGRES_PORT: "5432" POSTGRES_DB: "${LOCAL_POSTGRES_DB:-x_financial}" POSTGRES_USER: "${LOCAL_POSTGRES_USER:-x_financial}" POSTGRES_PASSWORD: "${LOCAL_POSTGRES_PASSWORD:-x_financial}" DATABASE_URL: "postgresql+psycopg://${LOCAL_POSTGRES_USER:-x_financial}:${LOCAL_POSTGRES_PASSWORD:-x_financial}@postgres:5432/${LOCAL_POSTGRES_DB:-x_financial}" - ONLYOFFICE_ENABLED: "${ONLYOFFICE_ENABLED:-false}" - ONLYOFFICE_PUBLIC_URL: "${ONLYOFFICE_PUBLIC_URL:-}" - ONLYOFFICE_BACKEND_URL: "${ONLYOFFICE_BACKEND_URL:-}" + ONLYOFFICE_ENABLED: "true" + ONLYOFFICE_PUBLIC_URL: "${LOCAL_ONLYOFFICE_PUBLIC_URL:-http://127.0.0.1:${ONLYOFFICE_PORT:-8082}}" + ONLYOFFICE_BACKEND_URL: "${LOCAL_ONLYOFFICE_BACKEND_URL:-http://main:${SERVER_PORT:-8000}}" ONLYOFFICE_JWT_SECRET: "${ONLYOFFICE_JWT_SECRET:-x-financial-onlyoffice-dev-secret}" - QDRANT_URL: "${QDRANT_URL:-}" + QDRANT_URL: "http://qdrant:6333" LIGHTRAG_WORKSPACE: "x_financial_knowledge" ports: - "${WEB_PORT:-5173}:${WEB_PORT:-5173}" @@ -95,9 +99,46 @@ services: networks: - financial-internal + onlyoffice: + image: onlyoffice/documentserver:latest + container_name: x-financial-onlyoffice + restart: unless-stopped + environment: + JWT_ENABLED: "true" + JWT_SECRET: "${ONLYOFFICE_JWT_SECRET:-x-financial-onlyoffice-dev-secret}" + ports: + - "127.0.0.1:${ONLYOFFICE_PORT:-8082}:80" + healthcheck: + test: ["CMD-SHELL", "curl -fsS http://127.0.0.1/healthcheck >/dev/null || exit 1"] + interval: 15s + timeout: 5s + retries: 10 + start_period: 60s + networks: + - financial-internal + + qdrant: + image: qdrant/qdrant:latest + container_name: x-financial-qdrant + restart: unless-stopped + ports: + - "127.0.0.1:${QDRANT_HTTP_PORT:-6333}:6333" + - "127.0.0.1:${QDRANT_GRPC_PORT:-6334}:6334" + volumes: + - qdrant-storage:/qdrant/storage + healthcheck: + test: ["CMD-SHELL", "bash -lc 'exec 3<>/dev/tcp/127.0.0.1/6333' || exit 1"] + interval: 15s + timeout: 5s + retries: 10 + start_period: 30s + networks: + - financial-internal + networks: financial-internal: name: financial-internal volumes: postgres-data: + qdrant-storage: diff --git a/document/development/2026-07-18/dev-logs/bugs/qdrant-compose-runtime-missing.md b/document/development/2026-07-18/dev-logs/bugs/qdrant-compose-runtime-missing.md new file mode 100644 index 0000000..f51302d --- /dev/null +++ b/document/development/2026-07-18/dev-logs/bugs/qdrant-compose-runtime-missing.md @@ -0,0 +1,13 @@ +# 默认 Compose 缺少 Qdrant 运行服务 + +日期:2026-07-18 +文档路径:document/development/2026-07-18/dev-logs/bugs/qdrant-compose-runtime-missing.md + +## 修复记录 + +- 15:54:记录 bug 修复:默认本地 Compose 未管理 Qdrant,知识检索与向量索引链路无法连接预期服务。 + - Git 提交检查:`git fetch --all --prune` 成功;upstream `origin/main` 无新提交;本地 ahead 19 条,最新为 `07241b46 fix(docker): manage local postgres in default compose`、`787bc3a4 feat(platform): close AI expense value loop`、`242d68c3 feat(approval): add task workflow and waiver decisions`,另有 16 条。 + - 修改:在 `docker-compose.yml` 中加入持久化 Qdrant 服务、健康检查、本机回环端口和内部网络;主服务显式使用 `http://qdrant:6333`,并等待 Qdrant 健康后启动。 + - 操作:执行 `docker compose config --quiet`,仅启动 `x-financial-qdrant`,未重建或重启 `local-x-financial-linux`。 + - 验证:Qdrant 1.18.3 容器健康,主容器内 `qdrant` 域名可解析,`/healthz` 返回 200,`/collections` 返回正常空集合;主容器仍保持原启动时间且重启次数为 0。 + - 影响:默认本地运行环境具备可持久化的向量存储依赖,后续知识检索不再依赖手工创建的散落容器。