新增 packages/mcp,基于 Streamable HTTP 暴露菜谱库能力,复用 packages/cook 的选菜算法:recommend_recipes 按现有食材推荐,search_recipes 条件检索,check_incompatible 食材相克,get_recipe 菜谱详情。容器内与 nginx 共存,映射 2230 端口供 Agent 连接。
30 lines
1.0 KiB
YAML
30 lines
1.0 KiB
YAML
services:
|
|
cook:
|
|
build:
|
|
context: .
|
|
dockerfile: Dockerfile
|
|
args:
|
|
# 统计配置在构建期编译进静态产物,未设置时使用项目默认值
|
|
NUXT_PUBLIC_CLARITY_PROJECT_ID: ${NUXT_PUBLIC_CLARITY_PROJECT_ID:-ks1ebw03i5}
|
|
NUXT_PUBLIC_CLARITY_DOMAINS: ${NUXT_PUBLIC_CLARITY_DOMAINS:-cook.yunyoujun.cn,cook.yunle.fun}
|
|
# 可选:传入 git commit,页脚会显示版本号与提交
|
|
CF_PAGES_COMMIT_SHA: ${CF_PAGES_COMMIT_SHA:-}
|
|
image: cook-web:latest
|
|
container_name: cook-web
|
|
restart: unless-stopped
|
|
ports:
|
|
# 容器内 nginx 监听 2229,对外同样暴露 2229
|
|
- '2229:2229'
|
|
# MCP Server 监听 2230,供 AI Agent 以 Streamable HTTP 连接
|
|
- '2230:2230'
|
|
environment:
|
|
COOK_MCP_PORT: 2230
|
|
COOK_MCP_HOST: 0.0.0.0
|
|
COOK_MCP_PATH: /mcp
|
|
healthcheck:
|
|
test: [CMD, wget, -q, -O, /dev/null, http://127.0.0.1:2229/]
|
|
interval: 30s
|
|
timeout: 3s
|
|
start_period: 5s
|
|
retries: 3
|