diff --git a/Containers/postgresql/Dockerfile b/Containers/postgresql/Dockerfile index 27b4e956..df01436c 100644 --- a/Containers/postgresql/Dockerfile +++ b/Containers/postgresql/Dockerfile @@ -1,5 +1,5 @@ -# From https://github.com/docker-library/postgres/blob/master/14/alpine/Dockerfile -FROM postgres:14.6-alpine +# From https://github.com/docker-library/postgres/blob/master/15/alpine/Dockerfile +FROM postgres:15.1-alpine RUN apk add --no-cache bash openssl shadow netcat-openbsd grep mawk diff --git a/Containers/postgresql/init-user-db.sh b/Containers/postgresql/init-user-db.sh index 8c1f2dc9..cfd3827a 100644 --- a/Containers/postgresql/init-user-db.sh +++ b/Containers/postgresql/init-user-db.sh @@ -6,6 +6,8 @@ touch "$DUMP_DIR/initialization.failed" psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE USER "oc_$POSTGRES_USER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB; ALTER DATABASE "$POSTGRES_DB" OWNER TO "oc_$POSTGRES_USER"; + GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "oc_$POSTGRES_USER"; + GRANT ALL PRIVILEGES ON SCHEMA public TO "oc_$POSTGRES_USER"; EOSQL rm "$DUMP_DIR/initialization.failed" diff --git a/Containers/postgresql/start.sh b/Containers/postgresql/start.sh index 5dfbb400..87e8706d 100644 --- a/Containers/postgresql/start.sh +++ b/Containers/postgresql/start.sh @@ -110,6 +110,8 @@ if ( [ -f "$DATADIR/PG_VERSION" ] && [ "$PG_MAJOR" != "$(cat "$DATADIR/PG_VERSIO psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL CREATE USER "$DB_OWNER" WITH PASSWORD '$POSTGRES_PASSWORD' CREATEDB; ALTER DATABASE "$POSTGRES_DB" OWNER TO "$DB_OWNER"; + GRANT ALL PRIVILEGES ON DATABASE "$POSTGRES_DB" TO "$DB_OWNER"; + GRANT ALL PRIVILEGES ON SCHEMA public TO "$DB_OWNER"; EOSQL fi