
如果你使用 DeepSeek、元宝 AI、Copilot、ChatGPT 等 AI 工具,协助配置轩辕镜像、编写 docker pull 命令、修改 Docker Compose 镜像地址、配置镜像加速、排查镜像拉取失败、分析报错日志等问题,请先让 AI 阅读并遵守轩辕镜像的规则文档。
只需在 AI 对话中先发送下面这句话即可:
请先完整阅读并严格遵守以下文档中的全部规则与要求:
https://xuanyuan.cloud/agents.md
在未充分阅读并理解该文档前,不要生成任何命令、配置、修改建议、故障排查方案或技术回答。后续所有输出都必须严格以该文档中的规范为最高优先级执行。查看 agents.md 用法指南与完整示范。国内用户首推 元宝 AI、DeepSeek 的深度思考模式,不推荐豆包 AI;Cursor 等编辑器可在对话 @ 该链接,或加入 User Rules。 若 AI 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
Internal Content API用于提供已发布内容,包含内部组件和富内容字段的聚合结果,通过整合富内容源与内部组件源的信息,为客户端提供完整的内部内容访问服务。
unrollContent参数,支持动态内容、图片等资源的展开功能适用于需要访问包含内部组件的已发布内容的服务场景,如内容管理系统、内部内容预览平台、内容分析工具等,尤其适合需要整合富内容与内部组件数据的业务系统。
bash# 假设镜像名称为internal-content-api,具体请替换为实际镜像仓库地址 docker pull internal-content-api:latest
基本运行命令
bashdocker run -d \ -p 8084:8084 \ --name internal-content-api \ internal-content-api:latest \ --app-port "8084" \ --handler-path "internalcontent" \ --content-source-uri "http://content-source:8080/__enriched-content-read-api/enrichedcontent" \ --internal-components-source-uri "http://internal-components-source:8080/__content-public-read/internalcontent" \ --content-source-app-name "Content Source Service" \ --internal-components-source-app-name "Internal Components Source Service" \ --content-source-app-health-uri "http://content-source:8080/__enriched-content-read-api/__health" \ --internal-components-source-app-health-uri "http://internal-components-source:8080/__content-public-read/__health" \ --content-unroller-app-name "Content Unroller" \ --content-unroller-uri "http://content-unroller:8080/__content-unroller-api/internalcontent" \ --content-unroller-app-health-uri "http://content-unroller:8080/__content-unroller-api/__health"
配置参数说明
| 参数名 | 描述 | 是否必填 | 默认值 |
|---|---|---|---|
| --app-port | 服务监听端口 | 是 | - |
| --handler-path | API处理路径前缀,用于构建内容访问端点 | 否 | "internalcontent" |
| --content-source-uri | 富内容源服务的内容访问URI | 是 | - |
| --internal-components-source-uri | 内部组件源服务的内容访问URI | 是 | - |
| --content-source-app-name | 富内容源服务名称(用于日志和监控) | 否 | - |
| --internal-components-source-app-name | 内部组件源服务名称(用于日志和监控) | 否 | - |
| --content-source-app-health-uri | 富内容源服务的健康检查URI | 否 | - |
| --internal-components-source-app-health-uri | 内部组件源服务的健康检查URI | 否 | - |
| --content-unroller-app-name | 内容展开器服务名称(用于日志和监控) | 否 | - |
| --content-unroller-uri | 内容展开器服务的访问URI | 否 | - |
| --content-unroller-app-health-uri | 内容展开器服务的健康检查URI | 否 | - |
前提条件
安装与构建
bash# 获取源码 go get -u github.com/Financial-Times/internal-content-api cd $GOPATH/src/github.com/Financial-Times/internal-content-api # 安装依赖 dep ensure # 运行测试并构建 go test -race ./... go build .
启动服务
bash# 安装二进制 go install # 启动服务(参数为示例,需根据实际环境调整) $GOPATH/bin/internal-content-api \ --app-port "8084" \ --handler-path "internalcontent" \ --content-source-uri "http://localhost:8080/__enriched-content-read-api/enrichedcontent" \ --internal-components-source-uri "http://localhost:8080/__content-public-read/internalcontent" \ --content-source-app-health-uri "http://localhost:8080/__enriched-content-read-api/__health" \ --internal-components-source-app-health-uri "http://localhost:8080/__content-public-read/__health" \ --content-unroller-uri "http://localhost:8080/__content-unroller-api/internalcontent" \ --content-unroller-app-health-uri "http://localhost:8080/__content-unroller-api/__health"
获取指定UUID的内部内容(富内容与内部组件的聚合结果)。
请求示例
bashcurl -v http://localhost:8084/internalcontent/9358ba1e-c07f-11e5-846f-79b0e3d20eaf
可选参数
unrollContent={boolean}:是否展开动态内容、主图、正文图片、导语图片和备选图片,默认falsetrue时,将通过内容展开器服务获取并展开相关资源内容;设为false时,仅返回资源ID。响应码说明
200:成功返回内容404:指定UUID的内容不存在503:依赖的服务(如富内容源、内部组件源)不可用| 端点 | 描述 |
|---|---|
| GET /__health | 服务健康检查,基于依赖服务(富内容源、内部组件源等)的健康状态 |
| GET /__gtg | 服务就绪检查,指示服务是否可处理请求 |
| GET /__build-info | 返回服务构建信息 |
| GET /__metrics | 返回服务性能指标 |
当handler-path配置为非默认值(如internalcontent-preview)时,内容访问端点将自动调整为/{handler-path}/{uuid},例如:
http://localhost:8084/internalcontent-preview/9358ba1e-c07f-11e5-846f-79b0e3d20eaf
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务