-
Build
docker build -t nominatim .
-
Copy <your_country>.osm.pbf to a local directory (i.e. /home/me/nominatimdata)
-
Initialize Nominatim Database
docker run -t -v /home/your-user:/data centralgpsnominatim_centralgps-nominatim sh /app/init.sh /data/paraguay-latest.osm.pbf postgresdata 4
Where 4 is the number of threads to use during import. In general the import of data in postgres is a very time consuming process that may take hours or days. If you run this process on a multiprocessor system make sure that it makes the best use of it. You can delete the /home/me/nominatimdata/<your_country>.osm.pbf once the import is finished.
-
After the import is finished the /home/me/nominatimdata/postgresdata folder will contain the full postgress binaries of a postgis/nominatim database. The easiest way to start the nominatim as a single node is the following:
docker run --restart=always -p 7654:5432 -p 8088:8080 -d --name nominatim -v /home/me/nominatimdata/postgresdata:/var/lib/postgresql/11/main nominatim bash /app/start.sh
-
Advanced configuration. If necessary you can split the osm installation into a database and restservice layer
In order to set the nominatin-db only node:
docker run --restart=always -p 7654:5432 -d -v /home/me/nominatimdata/postgresdata:/var/lib/postgresql/11/main nominatim sh /app/startpostgres.sh
After doing this create the /home/me/nominatimdata/conf folder and copy there the docker/local.php file. Then uncomment the following line:
@define('CONST_Database_DSN', 'pgsql://nominatim:[email protected]:7654/nominatim'); // <driver>://<username>:<password>@<host>:<port>/<database>
You can start the nominatib-rest only node with the following command:
docker run --restart=always -p 8088:8080 -d -v /home/me/nominatimdata/conf:/data nominatim sh /app/startapache.sh
-
Configure incremental update. By default CONST_Replication_Url configured for Monaco. If you want a different update source, you will need to declare
CONST_Replication_Url
in local.php. Documentation here. For example, to use the daily country extracts diffs for Gemany from geofabrik add the following:
@define('CONST_Replication_Url', 'http://download.geofabrik.de/europe/germany-updates');
Now you will have a fully functioning nominatim instance available at : http://localhost:8088/. Unlike the previous versions this one does not store data in the docker context and this results to a much slimmer docker image.
Full documentation for Nominatim update available here. For a list of other methods see the output of:
docker exec -it nominatim sudo -u postgres ./src/build/utils/update.php --help
The following command will keep your database constantly up to date:
docker exec -it nominatim sudo -u postgres ./src/build/utils/update.php --import-osmosis-all
If you have imported multiple country extracts and want to keep them up-to-date, have a look at the script in issue #60.