initial commit

This commit is contained in:
Peter Leurs 2025-08-15 23:23:00 +02:00
commit 50dcfec65a
5 changed files with 127 additions and 0 deletions

16
dbsetup.sh Normal file
View file

@ -0,0 +1,16 @@
#!/bin/bash
set -e
# This file is executed INSIDE the postgres container, but only the very first time
# the database is created. If any side-effects of this script need to be performed
# again, execute into the container and try again. There is no need for authentication
# inside the container, the connection is trusted
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname "$POSTGRES_DB" <<-EOSQL
CREATE USER zabbix WITH PASSWORD 'zabbix';
CREATE DATABASE zabbix;
GRANT ALL PRIVILEGES ON DATABASE zabbix TO zabbix;
EOSQL
psql -v ON_ERROR_STOP=1 --username "$POSTGRES_USER" --dbname zabbix <<-EOSQL
GRANT ALL PRIVILEGES ON SCHEMA public TO zabbix;
EOSQL