2022-06-06 10:28:01 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -e
|
|
|
|
|
2023-03-14 19:36:24 +00:00
|
|
|
app_password="$POSTGRES_APP_PASSWORD"
|
2022-06-06 10:28:01 +00:00
|
|
|
|
|
|
|
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
|
|
|
|
CREATE USER docker WITH PASSWORD '$app_password';
|
|
|
|
CREATE DATABASE docker;
|
|
|
|
GRANT ALL PRIVILEGES ON DATABASE docker TO docker;
|
|
|
|
|
|
|
|
-- SELECT datname FROM pg_database WHERE datistemplate = false;
|
|
|
|
-- SELECT table_schema,table_name
|
|
|
|
-- FROM information_schema.tables
|
|
|
|
-- ORDER BY table_schema,table_name;
|
|
|
|
EOSQL
|