This commit is contained in:
hailin 2025-05-16 17:48:01 +08:00
parent cda0db0ad6
commit 46e92f1473
2 changed files with 3 additions and 6 deletions

View File

@ -318,12 +318,6 @@ COPY --from=gosu /usr/local/bin/gosu /usr/local/bin/gosu
COPY ./docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
RUN chmod +x /usr/local/bin/docker-entrypoint.sh
# 在 entrypoint.sh 中 docker_init_database_dir 后添加修改 listen_addresses 的 sed 行
RUN sed -i '/docker_init_database_dir/a\
sed -i "s/^#*\\s*listen_addresses\\s*=.*/listen_addresses = '\''0.0.0.0'\''/" \"$PGDATA\"/postgresql.conf' \
/usr/local/bin/docker-entrypoint.sh
RUN mkdir -p /var/run/postgresql && chown postgres:postgres /var/run/postgresql
COPY supervisord.conf ./etc/

View File

@ -339,6 +339,9 @@ _main() {
ls /docker-entrypoint-initdb.d/ > /dev/null
docker_init_database_dir
sed -i "s/^#*\s*listen_addresses\s*=.*/listen_addresses = '0.0.0.0'/" "$PGDATA"/postgresql.conf
pg_setup_hba_conf "$@"
# PGPASSWORD is required for psql when authentication is required for 'local' connections via pg_hba.conf and is otherwise harmless