#!/bin/bash export_vars=$(cgroup-limits); export $export_vars source ${CONTAINER_SCRIPTS_PATH}/common.sh set -eu [ -f ${CONTAINER_SCRIPTS_PATH}/validate-variables.sh ] && source ${CONTAINER_SCRIPTS_PATH}/validate-variables.sh # Process the Redis configuration files log_info 'Processing Redis configuration files ...' if [[ -v REDIS_PASSWORD ]]; then envsubst < ${CONTAINER_SCRIPTS_PATH}/password.conf.template >> /etc/redis.conf else log_info 'WARNING: setting REDIS_PASSWORD is recommended' fi # Source post-init source if exists if [ -f ${CONTAINER_SCRIPTS_PATH}/post-init.sh ]; then log_info 'Sourcing post-init.sh ...' source ${CONTAINER_SCRIPTS_PATH}/post-init.sh fi # Restart the Redis server with public IP bindings unset_env_vars log_volume_info "${REDIS_DATADIR}" log_info 'Running final exec -- Only Redis logs after this point' exec ${REDIS_PREFIX}/bin/redis-server /etc/redis.conf --daemonize no "$@" 2>&1