This repo contains scripts to create postgres-init
docker to initialize all the databases. Initialization includes creation of tables and populating essential default data.
- Before building the docker create
repos
folder here.mkdir -p repos
- Fetch all the repositories
./get_db_data.sh <branch name>
- To manually build docker
- Review/change
TAG
that you need to create indocker_build.sh
. - Run
docker_build.sh
- Review/change
-
Set the following environment variables (given with an example below):
MOSIP_DB_NAME
: This is the DB folder name from which scripts have to be executed. Eg.mosip_master
.DB_SERVERIP
: Host name/IP of postgres server.DB_PORT
: Default 5432.SU_USER
: Super user. Defaultpostgres
SU_USER_PWD
: Super user password.DEFAULT_DB_NAME
: Specifypostgres
.DBUSER_PWD
: This is passed to the SQL scripts to create DB user, like,masteruser
.DML_FLAG
: Some databases may required default data to be populated using DMLs. Set this flag to0
or1
.
-
Run the deploy script from inside
db_scripts
folder.cd repos/commons/db_scripts ./deploy.sh
This project is licensed under the terms of Mozilla Public License 2.0.