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

21 lines
720 B
Bash
Executable File

#!/bin/bash
PROLE_HOME=~/dev/prole
export POSTGRES_PASSWORD=$(cat $PROLE_HOME/postgres-password.txt)
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 -u root \
--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