bpandey23 commited on
Commit
0ba050c
1 Parent(s): 40ec582

Update entrypoint.sh

Browse files
Files changed (1) hide show
  1. entrypoint.sh +2 -2
entrypoint.sh CHANGED
@@ -3,8 +3,8 @@
3
  # Check if the PostgreSQL data directory is empty
4
  if [ -z "$(ls -A /var/lib/postgresql/data)" ]; then
5
  echo "Initializing PostgreSQL database..."
6
- gosu foobar /usr/lib/postgresql/*/bin/initdb -D /var/lib/postgresql/data
7
  fi
8
 
9
  # Start the PostgreSQL server
10
- exec gosu foobar /usr/lib/postgresql/*/bin/postgres -D /var/lib/postgresql/data
 
3
  # Check if the PostgreSQL data directory is empty
4
  if [ -z "$(ls -A /var/lib/postgresql/data)" ]; then
5
  echo "Initializing PostgreSQL database..."
6
+ su - foobar -c "/usr/lib/postgresql/*/bin/initdb -D /var/lib/postgresql/data"
7
  fi
8
 
9
  # Start the PostgreSQL server
10
+ exec su - foobar -c "/usr/lib/postgresql/*/bin/postgres -D /var/lib/postgresql/data"