Skip to content

Commit

Permalink
Remove need for shared library PostgreSQL functions
Browse files Browse the repository at this point in the history
This is no longer needed as of PR
#2383
  • Loading branch information
jalessio committed Oct 20, 2019
1 parent 85861a7 commit b0d9d03
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 25 deletions.
23 changes: 1 addition & 22 deletions docker/postgres/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,25 +1,4 @@
FROM postgres:11

RUN apt-get update && \
apt-get install -y \
build-essential \
curl \
postgresql-server-dev-all && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

# Setup app location
RUN mkdir -p /app
WORKDIR /app

# Add custom database functions
ADD db/functions/ /app/db/functions/

# Get quad_tile.h header file from quad_tile repository and
# use it to make libpgosm.so for OSM-specific Postgres functions.
RUN cd db/functions && \
curl -# -O https://raw.githubusercontent.com/openstreetmap/quad_tile/9fcba83fcbca8a206fa518da5a52f840dc2ecb09/ext/quad_tile/quad_tile.h && \
make -e QTDIR=/app/db/functions libpgosm.so

# Add db init script to install OSM-specific Postgres functions
# Add db init script to install OSM-specific Postgres functions/extensions.
ADD docker/postgres/openstreetmap-postgres-init.sh /docker-entrypoint-initdb.d/
3 changes: 0 additions & 3 deletions docker/postgres/openstreetmap-postgres-init.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,3 @@
set -e

psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE EXTENSION btree_gist" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE FUNCTION maptile_for_point(int8, int8, int4) RETURNS int4 AS '/app/db/functions/libpgosm', 'maptile_for_point' LANGUAGE C STRICT" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE FUNCTION tile_for_point(int4, int4) RETURNS int8 AS '/app/db/functions/libpgosm', 'tile_for_point' LANGUAGE C STRICT" openstreetmap
psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" -c "CREATE FUNCTION xid_to_int4(xid) RETURNS int4 AS '/app/db/functions/libpgosm', 'xid_to_int4' LANGUAGE C STRICT" openstreetmap

0 comments on commit b0d9d03

Please sign in to comment.