diff --git a/compose.yaml b/compose.yaml index 3fda3e466..88a15cdb5 100644 --- a/compose.yaml +++ b/compose.yaml @@ -61,10 +61,10 @@ services: environment: - POSTGRES_HOST_AUTH_METHOD=trust volumes: - - ./docker/postgres/pg_hba.conf:/tmp/pg_hba.conf:ro - - ./docker/postgres/postgresql.conf:/tmp/postgresql.conf:ro - - ./docker/postgres/pgconfig.sh:/docker-entrypoint-initdb.d/_pgconfig.sh:ro - - ./docker/postgres/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro + - ./postgres/pg_hba.conf:/tmp/pg_hba.conf:ro + - .postgres/postgresql.conf:/tmp/postgresql.conf:ro + - .postgres/pgconfig.sh:/docker-entrypoint-initdb.d/_pgconfig.sh:ro + - .postgres/schema.sql:/docker-entrypoint-initdb.d/schema.sql:ro memcached: image: docker.io/library/memcached:latest diff --git a/postgres/pg_hba.conf b/postgres/pg_hba.conf new file mode 100644 index 000000000..b826e433d --- /dev/null +++ b/postgres/pg_hba.conf @@ -0,0 +1,3 @@ +local all all trust +host all all 0.0.0.0/0 trust +host all all ::1/128 trust \ No newline at end of file diff --git a/postgres/pgconfig.sh b/postgres/pgconfig.sh new file mode 100644 index 000000000..fbed96fe0 --- /dev/null +++ b/postgres/pgconfig.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +cat /tmp/pg_hba.conf > /var/lib/postgresql/data/pg_hba.conf +cat /tmp/postgresql.conf > /var/lib/postgresql/data/postgresql.conf + +echo "Custom pg_hba.conf and postgresql.conf successfully deployed." \ No newline at end of file diff --git a/postgres/postgresql.conf b/postgres/postgresql.conf new file mode 100644 index 000000000..a2f917845 --- /dev/null +++ b/postgres/postgresql.conf @@ -0,0 +1,6 @@ +listen_addresses='*' +unix_socket_permissions=0700 +max_connections=9990 +shared_preload_libraries=pg_stat_statements +session_preload_libraries=auto_explain +auto_explain.log_min_duration=100ms \ No newline at end of file diff --git a/postgres/schema.sql b/postgres/schema.sql new file mode 100644 index 000000000..9eb024aca --- /dev/null +++ b/postgres/schema.sql @@ -0,0 +1,5 @@ +CREATE USER uniworx WITH SUPERUSER PASSWORD 'uniworx'; +CREATE DATABASE uniworx_test; +GRANT ALL ON DATABASE uniworx_test TO uniworx; +CREATE DATABASE uniworx; +GRANT ALL ON DATABASE uniworx TO uniworx; \ No newline at end of file