peter-evans / nominatim-docker

Docker image for Nominatim
https://hub.docker.com/r/peterevans/nominatim/
MIT License
30 stars 16 forks source link

Allow persistence volume for Nominatim data #22

Open PremyslCerny opened 4 years ago

PremyslCerny commented 4 years ago

It would be nice (if it is not yet possible) to specify an external volume, where all Postgre + Nominatim data can be persisted, so that after restart of the container it does not take days to recreate the database and start the Nominatim service (which happens when user wants to use bigger data, such as Europe: https://download.geofabrik.de/europe-latest.osm.pbf). If it is or when it is possible, it would be nice to see entry in README on how to do it.

peter-evans commented 4 years ago

Hi @PremyslCerny

The original solution for my own use case was to persist data in object storage. See nominatim-k8s. I don't personally use either of these images now, so I'm just supporting. To be perfectly honest, if I was to redesign from scratch today I wouldn't have Postgres in the same container. My recommendation would be use a seperate Postgres instance which you can configure to persist data.

I can't promise anything soon, but I'll see if I can find some time to work on a feature to support remote Postgres containers.

mpi42 commented 4 years ago

how wold it be to commit on the running conainter to have a new image?

federicoalvarez-github commented 4 years ago

What about creating a VOLUME with the Postgres data? For example, making the whole /var/lib/postgresql/9.5/main as a mounted volume. So if the container is restarted the databases should be up and running. What else should be persisted? Thanks in advance.

federicoalvarez-github commented 4 years ago

For the past couple of hours I've been trying to get it to work with Volumes, but with no luck. I think the problem is that I cannot tell nominatim to "just run". It always has to perform the setup.php.

Is there a way to execute nominatim with out reprocessing the data?

certifirm commented 4 years ago

I am not a professional with docker, but can you take a look to this docker image?

https://github.com/Overv/openstreetmap-tile-server

It has the same database in a external volume with no problem. May be help you.