diff --git a/Dockerfile b/Dockerfile index 2d19a21..43d0ab8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -28,18 +28,20 @@ RUN set -euo pipefail; zypper -n in --no-recommends postgresql15-server distribu ENV LANG="en_US.utf8" ENV PG_MAJOR="15" ENV PG_VERSION="%%pg_version%%" -ENV PGDATA="/var/lib/postgresql/data" +ENV PGDATA="/var/lib/pgsql/data" ENTRYPOINT ["/usr/local/bin/docker-entrypoint.sh"] CMD ["postgres"] -VOLUME /var/lib/postgresql/data EXPOSE 5432 COPY docker-entrypoint.sh /usr/local/bin/ RUN set -euo pipefail; chmod +x /usr/local/bin/docker-entrypoint.sh; \ - ln -s su /usr/bin/gosu; \ + sed -i -e 's/exec gosu postgres "/exec setpriv --reuid=postgres --regid=postgres --clear-groups -- "/g' /usr/local/bin/docker-entrypoint.sh; \ mkdir /docker-entrypoint-initdb.d; \ + install -d -m 0700 -o postgres -g postgres $PGDATA; \ sed -ri "s|^#?(listen_addresses)\s*=\s*\S+.*|\1 = '*'|" /usr/share/postgresql15/postgresql.conf.sample STOPSIGNAL SIGINT HEALTHCHECK --interval=10s --start-period=10s --timeout=5s \ CMD pg_isready -U ${POSTGRES_USER:-postgres} -h localhost -p 5432 + +VOLUME $PGDATA diff --git a/postgres-15-image.changes b/postgres-15-image.changes index 0d7fa28..a5abaae 100644 --- a/postgres-15-image.changes +++ b/postgres-15-image.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Thu Mar 30 15:12:51 UTC 2023 - Dirk Mueller + +- Fix signal handling and use ~postgres/data as the default PGDATA location + ------------------------------------------------------------------- Wed Mar 29 13:44:26 UTC 2023 - Dan Čermák