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.
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.