+ postgresql server & pgadmin

This commit is contained in:
2026-10-13 19:02:35 +03:00
parent 9b3a69d296
commit 9516d0da25
7 changed files with 113 additions and 21 deletions

16
bash/psql.sh Executable file
View File

@ -0,0 +1,16 @@
#!/bin/bash
# psql in the pgsql container. Usage: ./psql.sh [database] [user] — defaults: intai intai
SCRIPT_DIR="$(realpath $(dirname "$(readlink -f "$0")"))"
. $SCRIPT_DIR/_docker-cmd.sh || {
echo "no docker cmd is presented" && exit 1
}
CONTAINER=$(docker ps --filter "label=com.docker.compose.service=pgsql" --format '{{.ID}}' | head -n1)
if [[ -z "${CONTAINER}" ]]; then
echo "Unable to find container: pgsql"
exit 1
fi
$DOCKER_CMD exec -ti ${CONTAINER} psql -U "${2:-intai}" -d "${1:-intai}"