#!/bin/sh set -ev # Volumes POSTGRES_DATA="${VOLUMES_DIR}/ckan/postgres_data" REDIS_CONF="${VOLUMES_DIR}/ckan/redis_conf" REDIS_DATA="${VOLUMES_DIR}/ckan/redis_data" SOLR_DATA="${VOLUMES_DIR}/ckan/solr_data" SOLR_LAYER="${LAYERS_DIR}/solr6_6.5.1-200313" DATAPUSHER_CONF="${VOLUMES_DIR}/ckan/datapusher_conf" DATAPUSHER_DATA="${VOLUMES_DIR}/ckan/datapusher_data" CKAN_CONF="${VOLUMES_DIR}/ckan/ckan_conf" CKAN_DATA="${VOLUMES_DIR}/ckan/ckan_data" # Create Postgres instance install -o 105432 -g 105432 -m 700 -d ${POSTGRES_DATA} spoc-container exec ckan-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 CKAN_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') export CKAN_DS_PWD=$(head -c 18 /dev/urandom | base64 | tr -d '+/=') spoc-container start ckan-postgres envsubst