- Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathpostgres.sh
More file actions
Latest commit
executable file
·20 lines (15 loc) · 525 Bytes
/
Copy pathpostgres.sh
File metadata and controls
executable file
·20 lines (15 loc) · 525 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/bash
if [ -f".env" ];then
source .env
fi
:${PG_IMAGE?"need to set image name PG_IMAGE, see README.md"}
:${ROOT=/root}
:${PGUSER=postgres}
:${PGDATA=$ROOT/db}
:${PGCONF=$ROOT/conf/postgresql.conf}
:${PGBIN=/usr/local/pgsql/bin}
:${PGCMD="$PGBIN/postgres -c config_file=$PGCONF"}
:${PGPORT=5432}
:${SUDO=""}# change to "sudo" if you aren't in docker group
:${OPTIONS="-d -w $ROOT -p $PGPORT:5432 -u $PGUSER -v $(pwd):$ROOT -e ROOT=$ROOT -e PGDATA=$PGDATA"}
$SUDO docker run $OPTIONS$PG_IMAGE$PGCMD