Minimalistic Docker images for Nominatim
n7m is a Numeronym for Nominatim.
n7m is Nominatim packaged in Docker images with separation of responsibilities between housing the web server, ui, applicaiton server, setup processes and PostgreSQL.
This set of Docker images seperates responsbility into 5 areas:
- n7m-app - The main Nomainatim service running uvicorn connecting to
n7m-gis
- feed - Uses the
n7m-app
image to set up then7m-gis
database. Can also be used for updates and downloading files.
- feed - Uses the
- n7m-gis - Postgis database
- n7m-ui - Test web user interface
- n7m-web - nginx web sever that hosts:
n7m-app
@ path: /api/v4/n7m-ui
@ path: /
|
v 8080
+--------------+ +--------------+
| | | |
| n7m-web |----->| n7m-ui |
| | 80 | |
+--------------+ +--------------+
| nginx | | nginx |
+--------------+ +--------------+
|
v 8000
+--------------+ +--------------+
| | | |
| n7m-app | | feed |
| | | |
+--------------+ +--------------+
| ubuntu:jammy | | n7m-app |
+--------------+ +--------------+
| | |
v 5432 v v
/--------\ +-----------------+ /--------\
| volume |<--| | | volume |
| pgdata | | n7m-gis | | data |
\--------/ + + \--------/
|-----------------+
| postgis/postgis |
+-----------------+
- Build all the images:
docker-compose build
- Download Wikimedia data and country grids (optional):
docker-compose run feed download --wiki --grid
- Download OSM Data. We recommend openmaptiles-tools. For Monaco:
docker run -v <path to working dir>/data:/tileset openmaptiles/openmaptiles-tools download-osm monaco
- Edit the OSM_FILENAME environment variable in
docker-compose.yml
file to select the downloaded OSM file.- The default is
monaco-latest.osm.pbf
which was downloaded in step 3.
- The default is
- Run
docker-compose up
- Since the import process is long, the
n7m-app
container terminates after 10 seconds. Rundocker-compose up
again after import so it restarts.
- Since the import process is long, the
- Browse to:
http://localhost:8080
- To reset the database:
docker-compose run feed reset
- To run setup again:
docker-compose run feed setup
- To update once:
docker-compose run feed update
- To run replication:
docker-compose run feed replication
For updates, consider these configurations:
- NOMINATIM_REPLICATION_MAX_DIFF - you will want to set this to a larger number.
- NOMINATIM_REPLICATION_URL - you will want to set this to a closer mirror.
To run n7m in AWS, the minimum EC2 Instance sizing is:
- Instance:
m5.4xlarge
- 64 GB RAM, 16 vCPUs - Storage: 350GB SSD for North America
- Instance:
m5.4xlarge
- 64 GB RAM, 16 vCPUs, 0.768/Hour- North America: 14.12 hours = $10.84
- Instance:
m5.8xlarge
- 128 GB RAM, 32 vCPUs, 1.536/Hour- North America: 10.57 hours = $16.23