Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 25 additions & 9 deletions Dockerfile.base
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:18-bullseye
FROM node:22-bookworm

# This dockerfile creates a base image, which contains all libpostal components.
# The actual ci build for pelias api does not run error sensitive and
Expand All @@ -9,14 +9,30 @@ FROM node:18-bullseye
# install libpostal
RUN apt-get update
RUN echo 'APT::Acquire::Retries "20";' >> /etc/apt/apt.conf
RUN apt-get install -y --no-install-recommends git curl make libsnappy-dev autoconf automake libtool python pkg-config
RUN apt-get install -y --no-install-recommends git curl make libsnappy-dev autoconf automake libtool python-is-python3 pkg-config

RUN mkdir -p /mnt/data

RUN git clone --single-branch https://github.com/openvenues/libpostal \
&& cd libpostal \
&& ./bootstrap.sh \
&& ./configure --datadir=/mnt/data \
&& make -j4 \
&& make install \
&& ldconfig
# libpostal's build fetches its language model data as release assets straight from
# github.com via several parallel curl workers; that fan-out intermittently trips
# GitHub's abuse/rate limiting and surfaces as spurious TLS/connection errors, so retry
# the whole clone+build+install a few times before giving up.
RUN set -e; \
for i in 1 2 3 4 5; do \
rm -rf libpostal && \
git clone --single-branch https://github.com/openvenues/libpostal \
&& cd libpostal \
&& ./bootstrap.sh \
&& ./configure --datadir=/mnt/data \
&& make -j4 \
&& make install \
&& ldconfig \
&& break; \
cd /; \
if [ "$i" -eq 5 ]; then \
echo "Failed to build libpostal after $i attempts" >&2; \
exit 1; \
fi; \
echo "libpostal build failed (attempt $i), retrying..." >&2; \
sleep 5; \
done
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
"license": "MIT",
"main": "index.js",
"bin": "./bin/start",
"resolutions": {
"node-postal": "1.3.0"
},
"scripts": {
"ciao": "node node_modules/ciao/bin/ciao -c test/ciao.json test/ciao",
"coverage": "node_modules/.bin/istanbul cover test/unit/run.js",
Expand Down Expand Up @@ -54,7 +57,7 @@
"pelias-categories": "^1.2.0",
"pelias-config": "^4.5.0",
"pelias-labels": "^1.8.0",
"pelias-logger": "^1.2.0",
"pelias-logger": "^2.0.0",
"pelias-microservice-wrapper": "^1.7.0",
"pelias-model": "^7.0.0",
"pelias-parser": "1.38.0",
Expand Down