#!/bin/sh set -ev # Volumes POSTGRES_DATA="${VOLUMES_DIR}/cts/postgres_data" CTS_CONF="${VOLUMES_DIR}/cts/cts_conf" CTS_LAYER="${LAYERS_DIR}/cts_0.8.0-200621" # Create Postgres instance install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA} spoc-container exec cts-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 database export CTS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') spoc-container start cts-postgres envsubst