Update entrypoint.sh
Browse files- entrypoint.sh +2 -4
entrypoint.sh
CHANGED
@@ -3,10 +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 |
-
/usr/lib/postgresql/*/bin/initdb -D /var/lib/postgresql/data
|
7 |
fi
|
8 |
|
9 |
# Start the PostgreSQL server
|
10 |
-
exec /usr/lib/postgresql/*/bin/postgres -D /var/lib/postgresql/data
|
11 |
-
|
12 |
-
echo "server started successfully............."
|
|
|
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 - postgres -c "/usr/lib/postgresql/*/bin/initdb -D /var/lib/postgresql/data"
|
7 |
fi
|
8 |
|
9 |
# Start the PostgreSQL server
|
10 |
+
exec su - postgres -c "/usr/lib/postgresql/*/bin/postgres -D /var/lib/postgresql/data"
|
|
|
|