This repository was archived by the owner on Dec 13, 2022. It is now read-only.
File tree 3 files changed +50
-0
lines changed
3 files changed +50
-0
lines changed Original file line number Diff line number Diff line change
1
+ FROM postgres:12
2
+ MAINTAINER sushantdhiman
"[email protected] "
3
+
4
+ ENV POSTGIS_MAJOR 3
5
+ ENV POSTGIS_VERSION 3.0.0+dfsg-2~exp1.pgdg100+1
6
+
7
+ RUN apt-get update \
8
+ && apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
9
+ && apt-get install -y --no-install-recommends \
10
+ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR=$POSTGIS_VERSION \
11
+ postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR-scripts=$POSTGIS_VERSION \
12
+ postgis=$POSTGIS_VERSION \
13
+ && rm -rf /var/lib/apt/lists/*
14
+
15
+
16
+ COPY ./init-sequelize-db.sh /docker-entrypoint-initdb.d/postgis.sh
17
+ COPY ./update-sequelize-db.sh /usr/local/bin/update-sequelize-db.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ # Perform all actions as $POSTGRES_USER
6
+ export PGUSER=" $POSTGRES_USER "
7
+
8
+ for DB in " $POSTGRES_DB " ; do
9
+ echo " Loading Sequelize extensions into $DB "
10
+ " ${psql[@]} " --dbname=" $DB " << -'EOSQL '
11
+ CREATE EXTENSION IF NOT EXISTS postgis;
12
+ CREATE EXTENSION IF NOT EXISTS btree_gist;
13
+ CREATE EXTENSION IF NOT EXISTS hstore;
14
+ CREATE EXTENSION IF NOT EXISTS citext;
15
+ EOSQL
16
+ done
Original file line number Diff line number Diff line change
1
+ #! /bin/sh
2
+
3
+ set -e
4
+
5
+ # Perform all actions as $POSTGRES_USER
6
+ export PGUSER=" $POSTGRES_USER "
7
+
8
+ POSTGIS_VERSION=" ${POSTGIS_VERSION%% +* } "
9
+
10
+ for DB in " $POSTGRES_DB " " ${@ } " ; do
11
+ echo " Updating Sequelize extensions '$DB ' to $POSTGIS_VERSION "
12
+ psql --dbname=" $DB " -c "
13
+ -- Upgrade PostGIS (includes raster)
14
+ CREATE EXTENSION IF NOT EXISTS postgis VERSION '$POSTGIS_VERSION ';
15
+ ALTER EXTENSION postgis UPDATE TO '$POSTGIS_VERSION ';
16
+ "
17
+ done
You can’t perform that action at this time.
0 commit comments