diff --git a/.env.example b/.env.example index d7eee296..26df8c59 100644 --- a/.env.example +++ b/.env.example @@ -446,6 +446,10 @@ POSTGRES_PASSWORD=secret POSTGRES_PORT=5432 POSTGRES_ENTRYPOINT_INITDB=./postgres/docker-entrypoint-initdb.d +### POSTGRES-POSTGIS ############################################## + +POSTGIS_INSTALL_PGSQL_HTTP_FOR_POSTGIS13=false + ### SQS ############################################## SQS_NODE_HOST_PORT=9324 diff --git a/docker-compose.yml b/docker-compose.yml index c901c8e8..0969ea8b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -622,7 +622,11 @@ services: ### PostgreSQL PostGis ################################### postgres-postgis: - build: ./postgres-postgis + build: + context: ./postgres-postgis + args: + - POSTGRES_VERSION=${POSTGRES_VERSION} + - INSTALL_PGSQL_HTTP_FOR_POSTGIS13=${POSTGIS_INSTALL_PGSQL_HTTP_FOR_POSTGIS13} volumes: - ${DATA_PATH_HOST}/postgres:/var/lib/postgresql/data ports: diff --git a/postgres-postgis/Dockerfile b/postgres-postgis/Dockerfile index 3b219f48..a25ea780 100644 --- a/postgres-postgis/Dockerfile +++ b/postgres-postgis/Dockerfile @@ -1,7 +1,27 @@ -FROM postgis/postgis:latest +ARG POSTGRES_VERSION=latest +FROM postgis/postgis:${POSTGRES_VERSION} LABEL maintainer="Mahmoud Zalt " +ARG INSTALL_PGSQL_HTTP_FOR_POSTGIS13=false + +RUN if [ ${INSTALL_PGSQL_HTTP_FOR_POSTGIS13} = true ]; then \ + apt-get clean \ + && apt-get update -yqq \ + && apt-get install -y \ + git \ + make \ + gcc \ + libcurl4-openssl-dev \ + postgresql-server-dev-13 \ + postgresql-13-cron \ + && git clone --recursive https://github.com/pramsey/pgsql-http.git \ + && cd pgsql-http/ \ + && make \ + && make install \ + && apt-get clean \ +;fi + CMD ["postgres"] EXPOSE 5432