Hi again, I would like to share a slightly better workaround
(does not restart PostgreSQL) for enabling localhost connections
(for example for servlets) in a postgres:17-alpine3.20 based Dockerfile:
RUN sed -i "s/listen_addresses=''/listen_addresses='localhost'/"
/usr/local/bin/docker-entrypoint.sh