docs: Update docker-compose.yml example to Postgres 16 and update initialization script (#8486)

This commit is contained in:
johnyb0y 2024-02-23 14:43:59 +01:00 committed by GitHub
parent 3ba2cdcadb
commit 9b0d98403a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 5 additions and 3 deletions

View file

@ -6,7 +6,7 @@ volumes:
services:
postgres:
image: postgres:11
image: postgres:16
restart: always
environment:
- POSTGRES_USER

View file

@ -6,7 +6,8 @@ if [ -n "${POSTGRES_NON_ROOT_USER:-}" ] && [ -n "${POSTGRES_NON_ROOT_PASSWORD:-}
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER ${POSTGRES_NON_ROOT_USER} WITH PASSWORD '${POSTGRES_NON_ROOT_PASSWORD}';
GRANT ALL PRIVILEGES ON DATABASE ${POSTGRES_DB} TO ${POSTGRES_NON_ROOT_USER};
EOSQL
GRANT CREATE ON SCHEMA public TO ${POSTGRES_NON_ROOT_USER};
EOSQL
else
echo "SETUP INFO: No Environment variables given!"
fi

View file

@ -31,7 +31,7 @@ x-shared: &shared
services:
postgres:
image: postgres:11
image: postgres:16
restart: always
environment:
- POSTGRES_USER

View file

@ -6,6 +6,7 @@ if [ -n "${POSTGRES_NON_ROOT_USER:-}" ] && [ -n "${POSTGRES_NON_ROOT_PASSWORD:-}
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER ${POSTGRES_NON_ROOT_USER} WITH PASSWORD '${POSTGRES_NON_ROOT_PASSWORD}';
GRANT ALL PRIVILEGES ON DATABASE ${POSTGRES_DB} TO ${POSTGRES_NON_ROOT_USER};
GRANT CREATE ON SCHEMA public TO ${POSTGRES_NON_ROOT_USER};
EOSQL
else
echo "SETUP INFO: No Environment variables given!"