Skip to content

Commit e4dab2b

Browse files
committed
Install pgBouncer
1 parent 125bb4b commit e4dab2b

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Dockerfile

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ FROM postgis/postgis:16-3.4
33
LABEL maintainer="PgOSM Flex - https://github.com/rustprooflabs/pgosm-flex"
44

55
ARG OSM2PGSQL_BRANCH=master
6+
ARG BOUNCER_VERSION=1.17.0
67

78
RUN apt-get update \
89
# Removed upgrade per https://github.com/rustprooflabs/pgosm-flex/issues/322
@@ -18,6 +19,7 @@ RUN apt-get update \
1819
curl unzip \
1920
postgresql-16-pgrouting \
2021
nlohmann-json3-dev \
22+
pkg-config libevent-2.1-7 libevent-dev libudns-dev \
2123
&& rm -rf /var/lib/apt/lists/*
2224

2325
RUN wget https://luarocks.org/releases/luarocks-3.9.2.tar.gz \
@@ -32,6 +34,19 @@ RUN curl -o /tmp/get-pip.py https://bootstrap.pypa.io/get-pip.py \
3234
RUN luarocks install inifile
3335
RUN luarocks install luasql-postgres PGSQL_INCDIR=/usr/include/postgresql/
3436

37+
# pgBouncer implementation based on: https://github.com/edoburu/docker-pgbouncer/blob/master/Dockerfile
38+
RUN curl -o /tmp/pgbouncer-$BOUNCER_VERSION.tar.gz -L https://pgbouncer.github.io/downloads/files/$BOUNCER_VERSION/pgbouncer-$BOUNCER_VERSION.tar.gz \
39+
&& cd /tmp \
40+
&& tar xvfz /tmp/pgbouncer-$BOUNCER_VERSION.tar.gz \
41+
&& cd pgbouncer-$BOUNCER_VERSION \
42+
&& ./configure --prefix=/usr --with-udns \
43+
&& make \
44+
&& cp pgbouncer /usr/bin \
45+
&& mkdir -p /etc/pgbouncer /var/log/pgbouncer /var/run/pgbouncer \
46+
&& cp etc/pgbouncer.ini /etc/pgbouncer/pgbouncer.ini.example \
47+
&& cp etc/userlist.txt /etc/pgbouncer/userlist.txt.example \
48+
&& touch /etc/pgbouncer/userlist.txt \
49+
&& chown -R postgres /var/run/pgbouncer /etc/pgbouncer
3550

3651
WORKDIR /tmp
3752
RUN git clone --depth 1 --branch $OSM2PGSQL_BRANCH https://github.com/openstreetmap/osm2pgsql.git \
@@ -45,6 +60,7 @@ RUN git clone --depth 1 --branch $OSM2PGSQL_BRANCH https://github.com/openstreet
4560
libexpat1-dev zlib1g-dev \
4661
libbz2-dev libproj-dev \
4762
curl \
63+
pkg-config libevent-dev \
4864
&& apt autoremove -y \
4965
&& cd /tmp && rm -r /tmp/osm2pgsql
5066

0 commit comments

Comments
 (0)