A nominatim image for use together with the vanilla mdillon/postgis image
3.5K
A docker setup for running a custom instance of the Nominatim geocoding service providing a nominatim-only image for use together with the plain mdillon/postgis image.
In contrast to other nominatim docker setups I have seen so far (see Alternatives) this setup has two main advantages:
This better complies with Docker's key principal: one container per service. The two docker containers are orchestrated using docker-compose.
This property is a consequence of 1.) because Nominatim of course needs the Database to import into. It also avoids nasty problems happening when trying to coordinate multiple processes from a Dockerfile.
This design of course means you cannot just prebuilt the ready-to-use Nominatim image on one host and copy it over to another (e.g. production) machine. But you can still copy the prebuilt database data, as described in section Transferring prebuilt instance to other host.
2.5.1, 2.5, latest (Dockerfile)nominatim-database:$ docker volume create --name nominatim-database
$ docker-compose up
This will command will:
After completion (should take only a few minutes for Monaco), you should be able to access the Nominatim instance at http://localhost:8080.
The initial import will only happen on first startup, because the entrypoint script will check if a database named nominatim already exists. In order to repeat the initial import, just remove the data volume nominatim-database:
$ docker volume rm nominatim-database
Create a file .env in the working directory with any of the following variables:
PLANET_DATA_URL: The PBF planet file to download and import (default http://download.geofabrik.de/europe/monaco-latest.osm.pbf)OSM2PGSQL_CACHE: The cache size (in MB) passed to nominatim via the --osm2pgsql-cache argument. More info here and here (default 14000)EXTERNAL_PORT: The external port (and ip address) to bind to (default 127.0.0.1:8080)IMPORT_DATA_DIR: The directory where the planet file data.osm.pbf is stored or downloaded to (default ./volumes/importdata)Transferring the prebuilt instance basically means copying the contents of the PostgreSQL database, which in this setup are stored in the named docker volume nominatim-database.
On the machine with the prebuilt nominatim instance, run the following steps:
docker-compose stop
nominatim-database docker volume to the target host:$ ./ssh-copy-docker-volume.sh nominatim-database example.com
Then on the target machine, follow the steps from the Getting Started section but skip step 3, the creation of the volume.
Content type
Image
Digest
Size
230.6 MB
Last updated
over 8 years ago
docker pull bringnow/nominatim