16 lines
489 B
Bash
16 lines
489 B
Bash
|
#!/bin/bash
|
||
|
set -e
|
||
|
|
||
|
app_password=$(cat "$POSTGRES_APP_PASSWORD_FILE")
|
||
|
|
||
|
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
|