ajnisbet / opentopodata

Open alternative to the Google Elevation API!
https://www.opentopodata.org
MIT License
327 stars 71 forks source link

Question: Mount config on docker run #99

Closed arnesetzer closed 1 month ago

arnesetzer commented 3 months ago

Is there a specific reason why the config.yaml is "baked in" into the docker image, but the data is not? Since make run loads the datasets dynamically, I was wondering why the config file is, more or less, static.

Building on the question: What's your opinion on a PR which makes it possible to load the config.yaml dynamically as the data?

ajnisbet commented 3 months ago

Good idea!

Because opentopodata uses caching both in memcached and in the python process's memory between requests, the safest thing to do would be to kill both uwsgi (which manages python) and memcached like this:

This is basically the same as what make build; make run would do. But at least you don't have to trigger it manually.

It would be nicer in theory to do something like only reloading the datasets that were changed in the config instead of nuking everything. This would speed up reloads! But I fear that the selective cache invalidation of that approach would be threaten the reliability of the software.

ajnisbet commented 1 month ago

Fixed in https://github.com/ajnisbet/opentopodata/commit/d1fc1a733a097b2fbd5dd39336c29a15fb8f0840