Open mbozorgi opened 2 years ago
it is completed an I could connect to DB through DBeaver but few questions:
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
PGDATA_DIR=cygpath -w $PGDATA_DIR;
export MSYS_NO_PATHCONV=1
fi
So moved the script from the repo folder to a folder on top of that, so now the DB files not in repo and need to commit and push
docker pull postgres:14-alpine3.14
start-postgresh.sh
PGDATA_DIR="$( pwd -P )/data" echo "${PGDATA_DIR}";
if [ ! -d "${PGDATA_DIR}" ] then echo "${PGDATA_DIR} does not exists. Can not start postgres database"; echo "Please run ./docker/start-postgres.sh from the project root directory." exit 1; fi
PG_DB=
PG_USER=
PG_PASSWORD=
if [ "$(expr substr $(uname -s) 1 10)" == "MINGW64_NT" ]; then
In windows use the windows path format
PGDATA_DIR=
cygpath -w $PGDATA_DIR;
export MSYS_NO_PATHCONV=1 fiecho "Using data directory ${PGDATA_DIR}"
docker run --name local-postgres \ -e POSTGRES_DB=$PG_DB \ -e POSTGRES_USER=$PG_USER \ -e POSTGRES_PASSWORD=$PG_PASSWORD \ -e 'PGDATA=/var/lib/postgresql/data/pgdata' \ -v ${PGDATA_DIR}:/var/lib/postgresql/data \ -p 5432:5432 \ -d postgres:14-alpine3.14