Skip to content

Commit

Permalink
Merge pull request #45 from adhocore/44-postgres
Browse files Browse the repository at this point in the history
fix: run init pg as root for postgres user
  • Loading branch information
adhocore authored Nov 1, 2023
2 parents 1d8b825 + eeb15e7 commit 62487f4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ if [ "$DISABLE_PGSQL" != "YES" ] && [ ! -f /run/postgresql/.init ]; then
echo "GRANT ALL PRIVILEGES ON DATABASE $PGSQL_DATABASE TO postgres;" >> $SQL

su postgres -c "pg_ctl -D '/usr/local/pgsql/data' -o '-c listen_addresses='' -p ${PGSQL_PORT:-5432}' -w start"
su postgres -c "psql -f '$SQL'"
su -c "psql --username=postgres --file='$SQL'"
rm -rf ~/.psql_history ~/.ash_history $SQL
su postgres -c "pg_ctl -D '/usr/local/pgsql/data' -m fast -w stop"
sed -i -E 's/host\s+all(.*)trust/host all\1password/' /usr/local/pgsql/data/pg_hba.conf
Expand Down

0 comments on commit 62487f4

Please sign in to comment.