Add database initialisation scripts

This commit is contained in:
Dana Lambert 2021-10-06 14:37:14 +13:00
parent 0ea165fcff
commit a66b8820df
3 changed files with 10 additions and 0 deletions

View file

@ -0,0 +1,6 @@
CREATE DATABASE right_tree;
\c right_tree
CREATE EXTENSION IF NOT EXISTS postgis;
GRANT ALL ON geometry_columns TO PUBLIC;
GRANT ALL ON spatial_ref_sys TO PUBLIC;

3
database/init_database.sh Executable file
View file

@ -0,0 +1,3 @@
docker-compose down --remove-orphans --volumes
docker-compose up postgres | sed '/PostgreSQL init process complete; ready for start up./q'
docker-compose down

View file

@ -38,6 +38,7 @@ services:
container_name: postgres
volumes:
- local-postgres-data:/var/lib/postgresql/data
- ./database/init:/docker-entrypoint-initdb.d
ports:
- "5432:5432"
environment: