diff --git a/images/db/Dockerfile b/images/db/Dockerfile index 9df94425..a7e6a566 100644 --- a/images/db/Dockerfile +++ b/images/db/Dockerfile @@ -1,2 +1,18 @@ FROM postgres:14 -ADD openstreetmap-postgres-init.sh /docker-entrypoint-initdb.d/ +RUN apt-get update \ + && apt-get install -y \ + postgresql-server-dev-14 \ + make \ + build-essential \ + postgresql-14-postgis-3 \ + && apt-get clean && rm -rf /var/lib/apt/lists/* + +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/ \ No newline at end of file diff --git a/images/db/openstreetmap-postgres-init.sh b/images/db/openstreetmap-postgres-init.sh deleted file mode 100755 index e95b7811..00000000 --- a/images/db/openstreetmap-postgres-init.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash -set -ex - -# Create 'openstreetmap' user -# Password and superuser privilege are needed to successfully run test suite -psql -v ON_ERROR_STOP=1 -U "$POSTGRES_USER" <<-EOSQL - CREATE USER openstreetmap SUPERUSER PASSWORD 'openstreetmap'; - GRANT ALL PRIVILEGES ON DATABASE openstreetmap TO openstreetmap; -EOSQL \ No newline at end of file