#!/bin/sh set -ev # Volumes POSTGRES_DATA="${VOLUMES_DIR}/sambro/postgres_data" SAHANA_DATA="${VOLUMES_DIR}/sambro/sahana_data" SAHANA_CONF="${VOLUMES_DIR}/sambro/sahana_conf" SAHANA_LAYER="${LAYERS_DIR}/sahana_1.0.3-210106" # Create Postgres instance install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA} spoc-container exec sambro-postgres -- initdb -D /var/lib/postgresql # Configure Postgres install -o 105432 -g 105432 -m 600 postgres_data/postgresql.conf ${POSTGRES_DATA}/postgresql.conf install -o 105432 -g 105432 -m 600 postgres_data/pg_hba.conf ${POSTGRES_DATA}/pg_hba.conf # Create PostgreSQL user and database export SAMBRO_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') spoc-container start sambro-postgres envsubst