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
4 changes: 2 additions & 2 deletions images/backup-restore/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
FROM python:3.9.9-slim

# Install Postgres client, GCP CLI, and Azure CLI
# Install Postgres client 17, GCP CLI, Azure CLI, and ZSTD compression tools
RUN apt-get update \
&& apt-get install -y curl apt-transport-https lsb-release gnupg \
&& echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" > /etc/apt/sources.list.d/pgdg.list \
&& curl -L https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - \
&& curl -sL https://aka.ms/InstallAzureCLIDeb | bash \
&& apt-get update \
&& apt-get install -y postgresql-client-14 wget \
&& apt-get install -y postgresql-client-17 wget zstd \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

Expand Down
53 changes: 37 additions & 16 deletions images/db/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,18 +1,39 @@
FROM postgres:14
RUN apt-get update \
&& apt-get install -y \
postgresql-server-dev-14 \
make \
# Stage 1: Compilar el plugin para PostgreSQL 17
FROM postgres:17 AS builder

# Instalar dependencias de compilación
RUN apt-get update && apt-get install -y --no-install-recommends \
ca-certificates \
build-essential \
postgresql-14-postgis-3 \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
cmake \
git \
libboost-program-options-dev \
libbz2-dev \
libexpat1-dev \
libosmium2-dev \
libprotozero-dev \
libyaml-cpp-dev \
libpqxx-dev \
postgresql-server-dev-17 \
&& update-ca-certificates \
&& rm -rf /var/lib/apt/lists/*

# Clonar y compilar el plugin osmdbt para PostgreSQL 17
RUN git clone https://github.com/openstreetmap/osmdbt.git /tmp/osmdbt && \
cd /tmp/osmdbt && \
git checkout v0.9 && \
cd postgresql-plugin && \
mkdir -p build && cd build && \
cmake .. && \
make

FROM postgres:17

COPY --from=builder /tmp/osmdbt/postgresql-plugin/build/osm-logical.so /usr/lib/postgresql/17/lib/osm-logical.so

RUN ln -s /usr/lib/postgresql/17/lib/osm-logical.so /usr/lib/postgresql/17/lib/osm_logical.so

ADD functions/functions.sql /usr/local/share/osm-db-functions.sql
ADD docker_postgres.sh /docker-entrypoint-initdb.d/
RUN mkdir -p db
RUN mkdir -p lib
ADD functions/ db/functions/
ADD lib/quad_tile/ lib/quad_tile/
RUN make -C db/functions/
RUN chown -R postgres lib/
RUN chown -R postgres db/
RUN chown postgres:postgres /usr/lib/postgresql/17/lib/osm-logical.so && \
chown postgres:postgres /usr/lib/postgresql/17/lib/osm_logical.so && \
chmod 755 /usr/lib/postgresql/17/lib/osm-logical.so && \
chmod 755 /usr/lib/postgresql/17/lib/osm_logical.so
9 changes: 8 additions & 1 deletion images/db/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Docker setup for postgres database instance

The OSM `API server` database - builds off a postgres 10 docker image, and installs custom functions needed by `openstreetmap`.
The OSM `API server` database - builds off a **PostgreSQL 17** docker image, and installs custom functions needed by `openstreetmap`.

The database includes the **osmdbt plugin v0.9** for logical replication support.

The functions currently are copied over from the `openstreetmap-website` code-base. There should ideally be a better way to do this.

Expand Down Expand Up @@ -35,3 +37,8 @@ In order to run this container we need environment variables, these can be found
```sh
pg_isready -h 127.0.0.1 -p 5432
```

### Installed Components

- **PostgreSQL**: 17
- **osmdbt plugin**: v0.9 (osm_logical replication plugin)
22 changes: 0 additions & 22 deletions images/db/docker_postgres.sh

This file was deleted.

24 changes: 0 additions & 24 deletions images/db/functions/Makefile

This file was deleted.

43 changes: 0 additions & 43 deletions images/db/functions/functions.sql

This file was deleted.

36 changes: 0 additions & 36 deletions images/db/functions/maptile.c

This file was deleted.

25 changes: 0 additions & 25 deletions images/db/functions/quadtile.c

This file was deleted.

23 changes: 0 additions & 23 deletions images/db/functions/xid_to_int4.c

This file was deleted.

3 changes: 0 additions & 3 deletions images/db/lib/quad_tile/.gitignore

This file was deleted.

5 changes: 0 additions & 5 deletions images/db/lib/quad_tile/extconf.rb

This file was deleted.

Loading
Loading