#!/usr/bin/env bash

set -eof pipefail

REDIS_CONFIG_FILE=/etc/redis/redis.conf

# Set password
if [ -n "$DRYCC_REDIS_PASSWORD" ]; then
    printf "\nrequirepass %s" "$DRYCC_REDIS_PASSWORD" >> $REDIS_CONFIG_FILE
fi

exec redis-server $REDIS_CONFIG_FILE "$@"
