Repository navigation
Update libpostal base image to Node 22 / Debian bookworm - #122
Merged
Merged
Conversation
- Bump base image from node:18-bullseye to node:22-bookworm; Node 18 reached EOL in April 2025. - Swap the now-removed `python` transitional package for `python-is-python3` on bookworm. - Wrap the libpostal clone/build/install in a retry loop: its build fetches ~2GB of language model data as GitHub Release assets via 12 parallel curl workers, which intermittently trips GitHub's abuse/rate limiting and previously required manual, error-prone local rebuilds. - Bump pelias-logger to ^2.0.0 to match the version used by all the HSL importer forks (pelias-schema, openstreetmap, pelias-vrk, etc.); its only breaking change is requiring Node >=22. - Pin node-postal to 1.3.0 via yarn resolutions: the previously resolved 1.1.2 (transitive via pelias-text-analyzer) used a V8 API (Object::CreationContext) removed in the V8 version bundled with Node 22, which broke the native addon build. Verified locally: - hsldevcom/libpostal:test built successfully. - pelias-api image builds and boots on the new base with no native addon errors. - Ran 12 real searches (autocomplete/search/reverse) against a pulled hsldevcom/pelias-data-container:latest (today's build, real ES 7.16.2 + full dataset - all returned HTTP 200 with correct results. - Pushed the rebuilt base image to hsldevcom/libpostal:latest on Docker Hub. Pre-existing jshint errors in controller/search.js, middleware/confidenceScoreDT.js, middleware/translate.js are unrelated to this change and left untouched. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> EOF )
vesameskanen
force-pushed
the
update-base-image-node22
branch
from
September 23, 2026 12:59
6e31869 to
c469038
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Dockerfile.basefromnode:18-bullseye(EOL since April 2025) tonode:22-bookworm.pythontransitional package forpython-is-python3(bookworm dropped it).libpostal_datafetches ~2GB of language model data as GitHub Release assets via 12 parallel curl workers, which intermittently trips GitHub's abuse/rate limiting.pelias-loggerto^2.0.0to match the version already used by all HSL importer forks (pelias-schema,openstreetmap,pelias-vrk,pelias-nlsfi-places-importer,pelias-gtfs,bikes-pelias). Its only breaking change is requiring Node >=22, which we now have.node-postalto1.3.0viayarn resolutions. The version transitively resolved throughpelias-text-analyzer(1.1.2) used a V8 API (Object::CreationContext) that was removed in the V8 build bundled with Node 22, breaking the native addon compile.1.3.0supports both old and new Node/V8 versions.yarn.lock-resolved patch/minor versions forexpress,morgan,lodash,pelias-labels,pelias-sorting,pelias-mock-logger(nopackage.jsonrange changes needed;yarn.lockisn't tracked in this repo).Testing
hsldevcom/libpostal:testfrom the updatedDockerfile.baselocally and confirmed a successful build (after ruling out an unrelated local Zscaler-proxy TLS interception issue).pelias-apion top of the new base and confirmed it boots without native-addon errors.hsldevcom/pelias-data-container:latest(today's build, real Elasticsearch 7.16.2 with the full production dataset) and ran the API against it with 12 real searches across autocomplete/search/reverse (Helsinki, Espoo, Tampere, Turku, Oulu, Vaasa) — all returnedHTTP 200with correct top results.test/unitfailure (autocomplete_token_matching_permutations.js, missing module from thepelias-queryfork) and thejshintlint errors incontroller/search.js,middleware/confidenceScoreDT.js,middleware/translate.jsboth already exist onmasterand are unrelated to this change.hsldevcom/libpostal:lateston Docker Hub (manual push, using local Docker Hub login — CI still doesn't automate this step).Not in scope for this PR
pelias-config,pelias-model,pelias-parser,joi,express5, etc.) — riskier, would need separate testing.pelias-data-containerdoes) — the base image build/push is still a manual local step; happy to follow up with a separate PR for that if wanted.node_modules/precommit-hook's owninstalllifecycle script unconditionally rewritespackage.json(injecting a"pre-commit"array and reformatting the file) on everyyarn install/npm install. Watch for this when re-running installs locally on this branch — diffpackage.jsonbefore committing.