mirror of
https://github.com/pgpointcloud/pointcloud.git
synced 2026-02-01 17:20:32 +00:00
Merge pull request #272 from abhineetgupta/docker_ag
added database initialization script to dockerfile
This commit is contained in:
commit
6e135c93bb
2
.gitignore
vendored
2
.gitignore
vendored
@ -26,3 +26,5 @@ pgsql/pc_pgsql.bc
|
||||
venv
|
||||
doc/build
|
||||
doc/__pycache__/
|
||||
|
||||
**/.DS_Store
|
||||
|
||||
@ -45,3 +45,6 @@ RUN apt-get update \
|
||||
zlib1g-dev \
|
||||
postgresql-server-dev-all \
|
||||
libxml2-dev
|
||||
|
||||
RUN mkdir -p /docker-entrypoint-initdb.d
|
||||
COPY ./initdb-pgpointcloud.sh /docker-entrypoint-initdb.d/10_pgpointcloud.sh
|
||||
26
docker/initdb-pgpointcloud.sh
Normal file
26
docker/initdb-pgpointcloud.sh
Normal file
@ -0,0 +1,26 @@
|
||||
#!/bin/sh
|
||||
|
||||
##### Script based on initialization script from postgis-docker #####
|
||||
|
||||
set -e
|
||||
|
||||
# Perform all actions as $POSTGRES_USER
|
||||
export PGUSER="$POSTGRES_USER"
|
||||
|
||||
# Create the 'template_postgis' template db
|
||||
"${psql[@]}" <<- 'EOSQL'
|
||||
CREATE DATABASE template_postgis IS_TEMPLATE true;
|
||||
EOSQL
|
||||
|
||||
# Load PostGIS into both template_database and $POSTGRES_DB
|
||||
for DB in template_postgis "$POSTGRES_DB"; do
|
||||
echo "Loading PostGIS and POINTCLOUD extensions into $DB"
|
||||
"${psql[@]}" --dbname="$DB" <<-'EOSQL'
|
||||
CREATE EXTENSION IF NOT EXISTS postgis;
|
||||
CREATE EXTENSION IF NOT EXISTS postgis_topology;
|
||||
CREATE EXTENSION IF NOT EXISTS fuzzystrmatch;
|
||||
CREATE EXTENSION IF NOT EXISTS postgis_tiger_geocoder;
|
||||
CREATE EXTENSION IF NOT EXISTS pointcloud;
|
||||
CREATE EXTENSION IF NOT EXISTS pointcloud_postgis;
|
||||
EOSQL
|
||||
done
|
||||
Loading…
x
Reference in New Issue
Block a user