Steps after installing PostreSQL-13
Edit your pg_hba.conf file (sometimes located at /var/lib/pgsql/data) and add the network of your host that will connect to the DB. If you are using a local docker installation your configuration should look like this:
(sections in bold are IriusRisk changes)
local all all peer
# IPv4 local connections:
host all all 127.0.0.1/32 ident
host all all 126.96.36.199/8 md5
host all all 127.0.0.1/32 md5
# IPv6 local connections:
host all all ::1/128 ident
# Allow replication connections from localhost, by a user with the
# replication privilege.
local replication all peer
host replication all 127.0.0.1/32 ident
host replication all ::1/128 ident
Then edit postgres.conf (located in the same directory as pg_hba.conf) to enable md5. You should only need to comment out the password encryption under the Authentication section, and it should look like this:
# - Authentication -
#authentication_timeout = 1min # 1s-600s
password_encryption = md5 # md5 or scram-sha-256
#db_user_namespace = off
In the same file you will need to update the listen address if the DB is in a remote location away from the application host:
listen_addresses = 'localhost, DB_HOSTS_IP_ADDRESS'
In some cases (local DB) you might have to open the listen address:
listen_addresses = '*'
After these changes you will need to restart the postgresql service for the changes to take effect. Once the service is restarted you will want to create the DB user and the DB.
Create user and database
Connect to your DB and issue the command:
create user iriusprod with createdb password 'alongandcomplexpassword2523';
create database iriusprod with owner='iriusprod';
At this point the database is ready for the docker container to connect.