diff --git a/Dockerfile b/Dockerfile index 7dec11e..f91b298 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,5 +6,16 @@ COPY backup_global_20260130_184353.sql /tmp/restore.sql # Set correct permissions RUN chmod 644 /tmp/restore.sql -# Configure pg_hba.conf to accept connections from any host -RUN echo "host all all 0.0.0.0/0 scram-sha-256" >> /usr/local/share/postgresql/pg_hba.conf.sample +# Create custom pg_hba.conf to allow connections from anywhere +RUN echo "# Allow connections from any IP address" > /tmp/pg_hba_additions.conf && \ + echo "host all all 0.0.0.0/0 scram-sha-256" >> /tmp/pg_hba_additions.conf && \ + echo "host all all ::/0 scram-sha-256" >> /tmp/pg_hba_additions.conf + +# Copy script to append to pg_hba.conf on startup +COPY <> /var/lib/postgresql/data/pg_hba.conf +echo "host all all ::/0 scram-sha-256" >> /var/lib/postgresql/data/pg_hba.conf +EOF + +RUN chmod +x /docker-entrypoint-initdb.d/00-allow-remote.sh