Add database initialisation scripts
This commit is contained in:
parent
0ea165fcff
commit
a66b8820df
3 changed files with 10 additions and 0 deletions
6
database/init/001_init_righttree.sql
Normal file
6
database/init/001_init_righttree.sql
Normal 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
3
database/init_database.sh
Executable 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
|
|
@ -38,6 +38,7 @@ services:
|
||||||
container_name: postgres
|
container_name: postgres
|
||||||
volumes:
|
volumes:
|
||||||
- local-postgres-data:/var/lib/postgresql/data
|
- local-postgres-data:/var/lib/postgresql/data
|
||||||
|
- ./database/init:/docker-entrypoint-initdb.d
|
||||||
ports:
|
ports:
|
||||||
- "5432:5432"
|
- "5432:5432"
|
||||||
environment:
|
environment:
|
||||||
|
|
Loading…
Reference in a new issue