From 5a1b2a6b0655bfa7a9cddbd97f806d590715db02 Mon Sep 17 00:00:00 2001 From: Alexander Overvoorde Date: Wed, 19 Feb 2020 21:04:24 +0100 Subject: [PATCH] Add support for host mounts (fixes #94) --- run.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/run.sh b/run.sh index ab7d659..5f2565f 100755 --- a/run.sh +++ b/run.sh @@ -24,6 +24,12 @@ if [ "$#" -ne 1 ]; then fi if [ "$1" = "import" ]; then + # Ensure that database directory is in right state + chown postgres:postgres -R /var/lib/postgresql + if [ ! -f /var/lib/postgresql/12/main/PG_VERSION ]; then + sudo -u postgres /usr/lib/postgresql/12/bin/pg_ctl -D /var/lib/postgresql/12/main/ initdb -o "--locale C.UTF-8" + fi + # Initialize PostgreSQL createPostgresConfig service postgresql start