prole/scripts/docker-run-prole-db.sh

19 lines
789 B
Bash
Executable File

# export POSTGRES_PASSWORD=$(openssl rand -base64 32)
# echo "$POSTGRES_PASSWORD" > postgres-password.txt
export POSTGRES_PASSWORD=$(cat postgres-password.txt)
PROLE_HOME=~/dev/prole
PG_VERSION=$(cat "$PROLE_HOME/conf/postgresql/.version" 2>/dev/null | tr -d '[:space:]')
RELEASE=$(cat "$PROLE_HOME/prole-db/.version" 2>/dev/null | tr -d '[:space:]')
if [[ "$RELEASE" =~ ^[0-9]+$ ]]; then RELEASE=$(printf "%03d" "$RELEASE"); fi
IMAGE="prole-db:${PG_VERSION:-17.7}-${RELEASE:-041}"
docker run --rm -it --hostname=prole-db-00n \
-e POSTGRES_PASSWORD="$POSTGRES_PASSWORD" \
--env=PATH=/usr/lib/postgresql/17/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin \
--volume=/Users/chrisfu/dev/prole/data:/data \
--network=bridge \
--entrypoint bash \
--restart=no \
$IMAGE