commit
f5832a8e2c
|
|
@ -423,18 +423,17 @@ init_postgres() {
|
|||
# Postgres does not allow it's server to be run with super user access, we use user postgres and the file system owner also needs to be the same user postgres
|
||||
chown postgres:postgres "$POSTGRES_DB_PATH"
|
||||
|
||||
# Please refer to base.dockerfile for the installation of Postgres
|
||||
# Initialize the postgres db file system
|
||||
su postgres -c "/usr/lib/postgresql/current/bin/initdb -D $POSTGRES_DB_PATH"
|
||||
su postgres -c "/usr/lib/postgresql/13/bin/initdb -D $POSTGRES_DB_PATH"
|
||||
sed -Ei "s,^#(unix_socket_directories =).*,\\1 '$TMP/pg-runtime'," "$POSTGRES_DB_PATH/postgresql.conf"
|
||||
|
||||
# Start the postgres server in daemon mode
|
||||
su postgres -c "/usr/lib/postgresql/current/bin/pg_ctl -D $POSTGRES_DB_PATH start"
|
||||
su postgres -c "/usr/lib/postgresql/13/bin/pg_ctl -D $POSTGRES_DB_PATH start"
|
||||
|
||||
# Create mockdb db and user and populate it with the data
|
||||
seed_embedded_postgres
|
||||
# Stop the postgres daemon
|
||||
su postgres -c "/usr/lib/postgresql/current/bin/pg_ctl stop -D $POSTGRES_DB_PATH"
|
||||
su postgres -c "/usr/lib/postgresql/13/bin/pg_ctl stop -D $POSTGRES_DB_PATH"
|
||||
fi
|
||||
else
|
||||
runEmbeddedPostgres=0
|
||||
|
|
@ -446,14 +445,14 @@ seed_embedded_postgres(){
|
|||
# Create mockdb database
|
||||
psql -U postgres -c "CREATE DATABASE mockdb;"
|
||||
# Create mockdb superuser
|
||||
su postgres -c "/usr/lib/postgresql/current/bin/createuser mockdb -s"
|
||||
su postgres -c "/usr/lib/postgresql/13/bin/createuser mockdb -s"
|
||||
# Dump the sql file containing mockdb data
|
||||
psql -U postgres -d mockdb --file='/opt/appsmith/templates/mockdb_postgres.sql'
|
||||
|
||||
# Create users database
|
||||
psql -U postgres -c "CREATE DATABASE users;"
|
||||
# Create users superuser
|
||||
su postgres -c "/usr/lib/postgresql/current/bin/createuser users -s"
|
||||
su postgres -c "/usr/lib/postgresql/13/bin/createuser users -s"
|
||||
# Dump the sql file containing mockdb data
|
||||
psql -U postgres -d users --file='/opt/appsmith/templates/users_postgres.sql'
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#!/bin/bash
|
||||
|
||||
rm -f /appsmith-stacks/data/postgres/main/core.*
|
||||
exec /usr/lib/postgresql/current/bin/postgres -D "/appsmith-stacks/data/postgres/main" -c listen_addresses=127.0.0.1
|
||||
exec /usr/lib/postgresql/13/bin/postgres -D "/appsmith-stacks/data/postgres/main" -c listen_addresses=127.0.0.1
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user