Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable Config Include in default configuration #1267

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion Dockerfile-alpine.template
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,9 @@ RUN set -eux; \

# make the sample config easier to munge (and "correct by default")
RUN set -eux; \
cp -v /usr/local/share/postgresql/postgresql.conf.sample /usr/local/share/postgresql/postgresql.conf.sample.orig; \
mkdir -p /etc/postgresql/conf.d; \
mv -v /usr/local/share/postgresql/postgresql.conf.sample /usr/local/share/postgresql/postgresql.conf.sample.orig; \
awk '/# CONFIG FILE INCLUDES/ {print; getline; print; print "\ninclude_dir = '\''/etc/postgresql/conf.d'\''"; next} 1' /usr/local/share/postgresql/postgresql.conf.sample.orig > /usr/local/share/postgresql/postgresql.conf.sample; \
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/local/share/postgresql/postgresql.conf.sample; \
grep -F "listen_addresses = '*'" /usr/local/share/postgresql/postgresql.conf.sample

Expand Down
7 changes: 4 additions & 3 deletions Dockerfile-debian.template
Original file line number Diff line number Diff line change
Expand Up @@ -173,10 +173,11 @@ RUN set -ex; \
# make the sample config easier to munge (and "correct by default")
RUN set -eux; \
dpkg-divert --add --rename --divert "/usr/share/postgresql/postgresql.conf.sample.dpkg" "/usr/share/postgresql/$PG_MAJOR/postgresql.conf.sample"; \
cp -v /usr/share/postgresql/postgresql.conf.sample.dpkg /usr/share/postgresql/postgresql.conf.sample; \
ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$PG_MAJOR/"; \
mkdir -p /etc/postgresql/conf.d; \
awk '/# CONFIG FILE INCLUDES/ {print; getline; print; print "\ninclude_dir = '\''/etc/postgresql/conf.d'\''"; next} 1' /usr/share/postgresql/postgresql.conf.sample.dpkg > /usr/share/postgresql/postgresql.conf.sample; \
sed -ri "s!^#?(listen_addresses)\s*=\s*\S+.*!\1 = '*'!" /usr/share/postgresql/postgresql.conf.sample; \
grep -F "listen_addresses = '*'" /usr/share/postgresql/postgresql.conf.sample
grep -F "listen_addresses = '*'" /usr/share/postgresql/postgresql.conf.sample; \
ln -sv ../postgresql.conf.sample "/usr/share/postgresql/$PG_MAJOR/";

RUN install --verbose --directory --owner postgres --group postgres --mode 3777 /var/run/postgresql

Expand Down