pelias / geonames

Import pipeline for geonames in to Pelias
https://pelias.io
MIT License
45 stars 37 forks source link

Support metadata download durng `npm install` #399

Closed orangejulius closed 3 years ago

orangejulius commented 3 years ago

It turns out the fix for downloading metadata in the Docker images from https://github.com/pelias/geonames/pull/398 did not work.

We need to allow NPM scripts during npm install so that, among other things, better-sqlite3 can install its Node.js bindings.

In the long run, I wonder if we should rethink the entire metadata approach. Surely it makes sense to treat it as part of the regular download process like we do the inventory.json file for the WOF download. That would make a lot of things conceptually easier, and remove one of the key "special" parts of this importer, bringing it more in line with all the others.

But for the short term I wanted to fix the issue without making any changes to peoples workflows or any significant code changes.

So this PR adds just enough files to the Docker image before npm install is run so that the metadata download will work. We don't want to copy all the code files first: that would make repeated docker builds slower during local development. This should be a decent middle ground that gets things working again.