prole/prole-db/prole-db-entrypoint.sh

13 lines
503 B
Bash

#!/usr/bin/env bash
set -Eeuo pipefail
# If user runs the default "postgres" command, optionally force pg_tde preload.
if [[ "${1:-}" == "postgres" ]] && [[ "${ENABLE_PG_TDE:-}" == "1" ]]; then
# Only inject if user didn't already set shared_preload_libraries explicitly
if ! printf '%q ' "$@" | grep -q "shared_preload_libraries"; then
set -- "$@" -c "shared_preload_libraries=pg_tde"
fi
fi
# Delegate everything else to the official entrypoint
exec /usr/local/bin/docker-entrypoint.sh "$@"