
如果你使用 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 无法访问外链,可 打开说明文档 复制全文粘贴。文档会随站点更新,复制内容可能过期,建议定期检查。
!https://img.shields.io/badge/Nominatim%20Version-5.1.0-blue?style=flat-square !https://img.shields.io/github/actions/workflow/status/mediagis/nominatim-docker/ci.yml?branch=master&style=flat-square !https://img.shields.io/github/all-contributors/mediagis/nominatim-docker?style=flat-square !https://img.shields.io/docker/pulls/mediagis/nominatim?style=flat-square !https://img.shields.io/docker/image-size/mediagis/nominatim?style=flat-square
Nominatim Docker 镜像是一个 100% 可正常工作的容器化解决方案,用于部署 https://github.com/openstreetmap/Nominatim 地理编码服务。Nominatim 是 OpenStreetMap (OSM) 项目的开源地理编码工具,支持从地址文本查询地理位置(正向地理编码)和从坐标反查地址(反向地理编码)。本镜像将 Nominatim 及其依赖组件(如 PostgreSQL 数据库、Apache Web 服务器)打包为单容器,提供便捷的部署和使用体验。
通过以下命令可快速部署一个使用小型数据集(如摩纳哥)的 Nominatim 服务:
bashdocker run -it \ -e PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf \ -p 8080:8080 \ --name nominatim \ docker.xuanyuan.run/mediagis/nominatim:5.1
参数说明:
-e PBF_URL: 指定 OSM PBF 数据文件的下载 URL(必填),用于初始化数据库。-p 8080:8080: 端口映射,将容器内 Apache 服务的 8080 端口映射到主机的 8080 端口。--name nominatim: 容器名称,便于后续管理。mediagis/nominatim:5.1: 镜像名称及标签(Nominatim 5.1 版本)。数据导入完成后,可通过 http://localhost:8080/search.php?q=avenue%20pasteur 访问 Nominatim API 进行地址查询。
可通过指定标签拉取特定版本的 Nominatim 镜像,例如:
bash# 拉取 Nominatim 5.1 版本 docker pull docker.xuanyuan.run/mediagis/nominatim:5.1
所有可用标签参见 https://hub.docker.com/r/mediagis/nominatim/tags%E3%80%82
| 环境变量 | 说明 | 是否必填 |
|---|---|---|
PBF_URL | OSM PBF 数据文件的 HTTP/HTTPS 下载 URL,用于数据库初始化 | 是 |
| (其他高级配置) | 如需持久化数据、数据库调优、更新数据等高级配置,参见 详细指南 | 否 |
创建 docker-compose.yml 文件,内容如下:
yamlversion: '3' services: nominatim: image: docker.xuanyuan.run/mediagis/nominatim:5.1 container_name: nominatim ports: - "8080:8080" environment: - PBF_URL=https://download.geofabrik.de/europe/monaco-latest.osm.pbf volumes: - nominatim_data:/var/lib/postgresql/14/main # 持久化数据库数据(可选) restart: unless-stopped volumes: nominatim_data: # 定义数据卷,用于持久化数据库文件
通过以下命令启动服务:
bashdocker-compose up -d
关于 Nominatim 的最新安全版本支持和安全策略,参见官方文档:https://github.com/osm-search/Nominatim/blob/master/SECURITY.md%E3%80%82
本项目旨在提供一个易用的单容器镜像,将所有服务组件整合在一起,简化部署流程。缺点是 Dockerfile 相对复杂,定制化难度较高。
若需将各组件拆分为独立容器(如数据库、Web 服务分离),可参考项目:https://github.com/smithmicro/n7m%E3%80%82
感谢以下贡献者对本项目的支持(emoji 说明):
Andrew https://github.com/mediagis/nominatim-docker/commits?author=winsento https://github.com/mediagis/nominatim-docker/commits?author=winsento | https://github.com/dlucia https://github.com/mediagis/nominatim-docker/commits?author=dlucia | https://github.com/geomark https://github.com/mediagis/nominatim-docker/commits?author=geomark | https://github.com/philipkozeny 🚇 https://github.com/mediagis/nominatim-docker/commits?author=philipkozeny https://github.com/mediagis/nominatim-docker/commits?author=philipkozeny https://github.com/mediagis/nominatim-docker/pulls?q=is%3Apr+reviewed-by%3Aphilipkozeny https://github.com/mediagis/nominatim-docker/commits?author=philipkozeny | Cezary Morga https://github.com/mediagis/nominatim-docker/commits?author=therek | https://github.com/thomasnordquist https://github.com/mediagis/nominatim-docker/commits?author=thomasnordquist |
Andrey Ruíz https://github.com/mediagis/nominatim-docker/commits?author=davkorss | https://github.com/UntitleDude https://github.com/mediagis/nominatim-docker/commits?author=UntitleDude | Jack McKernan https://github.com/mediagis/nominatim-docker/commits?author=jmcker | mtmail https://github.com/mediagis/nominatim-docker/commits?author=mtmail https://github.com/mediagis/nominatim-docker/commits?author=mtmail 💬 https://github.com/mediagis/nominatim-docker/pulls?q=is%3Apr+reviewed-by%3Amtmail | Andrey Oblivantsev https://github.com/mediagis/nominatim-docker/commits?author=eSlider | Simone https://github.com/mediagis/nominatim-docker/commits?author=sromano1992 |
| https://github.com/DuncanMackintosh https://github.com/mediagis/nominatim-docker/commits?author=DuncanMackintosh https://github.com/mediagis/nominatim-docker/commits?author=DuncanMackintosh | Iiro Alhonen https://github.com/mediagis/nominatim-docker/commits?author=Iikeli | Mikhail Snetkov https://github.com/mediagis/nominatim-docker/commits?author=ufoproger | https://github.com/FritschAuctores https://github.com/mediagis/nominatim-docker/commits?author=FritschAuctores | https://github.com/rebos https://github.com/mediagis/nominatim-docker/commits?author=rebos | Leonard Ehrenfried 🚇 |
您可以使用以下命令拉取该镜像。请将 <标签> 替换为具体的标签版本。如需查看所有可用标签版本,请访问 标签列表页面。
来自真实用户的反馈,见证轩辕镜像的优质服务