build(docker/database): work on postgres config

This commit is contained in:
Sarah Vaupel 2024-09-23 00:18:13 +02:00
parent ecb085ad10
commit cf76752894
4 changed files with 7 additions and 3 deletions

View File

@ -3,6 +3,9 @@ FROM docker.io/postgres:12
# Allow for connecting to database without password authentication
ENV POSTGRES_HOST_AUTH_METHOD=trust
RUN cp /mnt/fradrive/docker/database/pg_hba.conf /docker-entrypoint-initdb.d/pg_hba.conf && chown postgres:postgres /docker-entrypoint-initdb.d/pg_hba.conf
RUN cp /mnt/fradrive/docker/database/postgresql.conf /docker-entrypoint-initdb.d/postgresql.conf && chown postgres:postgres /docker-entrypoint-initdb.d/postgresql.conf
RUN cp /mnt/fradrive/docker/database/schema.sql /schema.sql && chown postgres:postgres /schema.sql
RUN cp /mnt/fradrive/docker/database/initdb.sh /etc/fradrive-db && chmod 755 /etc/fradrive-db

View File

@ -2,7 +2,7 @@
# Init and start the postgres daemon
initdb --no-locale
pg_ctl start -w -o "-c listen_addresses=0.0.0.0 -c unix_socket_permissions=0700 -c max_connections=9990 -c shared_preload_libraries=pg_stat_statements -c session_preload_libraries=auto_explain -c auto_explain.log_min_duration=100ms" # COPY postgresql.conf and postgres_hba.conf resulted in error (Invalid data directory)
pg_ctl start -w -o "-c listen_addresses='*' -c unix_socket_permissions=0700 -c max_connections=9990 -c shared_preload_libraries=pg_stat_statements -c session_preload_libraries=auto_explain -c auto_explain.log_min_duration=100ms"
POSTGRID=`cat /var/lib/postgresql/data/postmaster.pid | perl -le '<>=~m#(\d+)# and print $1'`
# Create uniworx and uniworx_test database

View File

@ -1 +1,2 @@
local all all trust
host all all ::1/128 md5
host all postgres 127.0.0.1/32 md5

View File

@ -1,4 +1,4 @@
listen_addresses=0.0.0.0
listen_addresses='*'
unix_socket_permissions=0700
max_connections=9990
shared_preload_libraries=pg_stat_statements