docker-postgres/initScript/init.sh
RouxAntoine 4c4390756c
All checks were successful
Main / build (push) Successful in 8m6s
feat: configure grant all on public schema for docker user
2024-10-20 21:13:59 +02:00

17 lines
526 B
Bash

#!/bin/bash
set -e
app_password="$POSTGRES_APP_PASSWORD"
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 SCHEMA public TO 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