From fb680e943a065145f655a0b75e162b72902100af Mon Sep 17 00:00:00 2001 From: Anatolii Zimovskii Date: Mon, 21 Mar 2022 22:14:03 +0300 Subject: [PATCH] updates --- linux/ecosystem/postgres/10/Dockerfile | 3 +- linux/ecosystem/postgres/11/Dockerfile | 3 +- linux/ecosystem/postgres/12/Dockerfile | 3 +- linux/ecosystem/postgres/13/Dockerfile | 3 +- linux/ecosystem/postgres/14/Dockerfile | 3 +- linux/ecosystem/postgres/8.2/Dockerfile | 9 +++-- linux/ecosystem/postgres/8.3/Dockerfile | 9 +++-- linux/ecosystem/postgres/8.4/Dockerfile | 9 +++-- linux/ecosystem/postgres/9.0/Dockerfile | 9 +++-- linux/ecosystem/postgres/9.1/Dockerfile | 39 ++++++++++++++++++++-- linux/ecosystem/postgres/9.2/Dockerfile | 9 +++-- linux/ecosystem/postgres/9.3/Dockerfile | 9 +++-- linux/ecosystem/postgres/9.4/Dockerfile | 3 +- linux/ecosystem/postgres/9.5/Dockerfile | 3 +- linux/ecosystem/postgres/9.6/Dockerfile | 3 +- linux/ecosystem/postgres/latest/Dockerfile | 3 +- 16 files changed, 88 insertions(+), 32 deletions(-) diff --git a/linux/ecosystem/postgres/10/Dockerfile b/linux/ecosystem/postgres/10/Dockerfile index 149d22520..44cf44e99 100644 --- a/linux/ecosystem/postgres/10/Dockerfile +++ b/linux/ecosystem/postgres/10/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/11/Dockerfile b/linux/ecosystem/postgres/11/Dockerfile index cc6a65f9e..eac98e7cb 100644 --- a/linux/ecosystem/postgres/11/Dockerfile +++ b/linux/ecosystem/postgres/11/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/12/Dockerfile b/linux/ecosystem/postgres/12/Dockerfile index 28e09b43b..ca0a6c795 100644 --- a/linux/ecosystem/postgres/12/Dockerfile +++ b/linux/ecosystem/postgres/12/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/13/Dockerfile b/linux/ecosystem/postgres/13/Dockerfile index 201112140..0b551b1cd 100644 --- a/linux/ecosystem/postgres/13/Dockerfile +++ b/linux/ecosystem/postgres/13/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/14/Dockerfile b/linux/ecosystem/postgres/14/Dockerfile index 779b9c992..bdc6505ec 100644 --- a/linux/ecosystem/postgres/14/Dockerfile +++ b/linux/ecosystem/postgres/14/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/8.2/Dockerfile b/linux/ecosystem/postgres/8.2/Dockerfile index 619fe9690..6db85baaf 100644 --- a/linux/ecosystem/postgres/8.2/Dockerfile +++ b/linux/ecosystem/postgres/8.2/Dockerfile @@ -52,9 +52,14 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/8.3/Dockerfile b/linux/ecosystem/postgres/8.3/Dockerfile index ee1e3ebcf..3832f41d1 100644 --- a/linux/ecosystem/postgres/8.3/Dockerfile +++ b/linux/ecosystem/postgres/8.3/Dockerfile @@ -53,9 +53,14 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/8.4/Dockerfile b/linux/ecosystem/postgres/8.4/Dockerfile index e24dd3a96..85d64923a 100644 --- a/linux/ecosystem/postgres/8.4/Dockerfile +++ b/linux/ecosystem/postgres/8.4/Dockerfile @@ -52,9 +52,14 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/9.0/Dockerfile b/linux/ecosystem/postgres/9.0/Dockerfile index df25f3262..266be74ce 100644 --- a/linux/ecosystem/postgres/9.0/Dockerfile +++ b/linux/ecosystem/postgres/9.0/Dockerfile @@ -52,9 +52,14 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/9.1/Dockerfile b/linux/ecosystem/postgres/9.1/Dockerfile index d204f1d01..d950f3407 100644 --- a/linux/ecosystem/postgres/9.1/Dockerfile +++ b/linux/ecosystem/postgres/9.1/Dockerfile @@ -54,9 +54,44 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] + +# We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL +# calls "Fast Shutdown mode" wherein new connections are disallowed and any +# in-progress transactions are aborted, allowing PostgreSQL to stop cleanly and +# flush tables to disk, which is the best compromise available to avoid data +# corruption. +# +# Users who know their applications do not keep open long-lived idle connections +# may way to use a value of SIGTERM instead, which corresponds to "Smart +# Shutdown mode" in which any existing sessions are allowed to finish and the +# server stops when all sessions are terminated. +# +# See https://www.postgresql.org/docs/12/server-shutdown.html for more details +# about available PostgreSQL server shutdown signals. +# +# See also https://www.postgresql.org/docs/12/server-start.html for further +# justification of this as the default value, namely that the example (and +# shipped) systemd service files use the "Fast Shutdown mode" for service +# termination. +# +STOPSIGNAL SIGINT +# +# An additional setting that is recommended for all users regardless of this +# value is the runtime "--stop-timeout" (or your orchestrator/runtime's +# equivalent) for controlling how long to wait between sending the defined +# STOPSIGNAL and sending SIGKILL (which is likely to cause data corruption). +# +# The default in most runtimes (such as Docker) is 10 seconds, and the +# documentation at https://www.postgresql.org/docs/12/server-start.html notes +# that even 90 seconds may not be long enough in many instances. EXPOSE 5432 CMD ["postgres"] diff --git a/linux/ecosystem/postgres/9.2/Dockerfile b/linux/ecosystem/postgres/9.2/Dockerfile index 73c9d1483..88327769d 100644 --- a/linux/ecosystem/postgres/9.2/Dockerfile +++ b/linux/ecosystem/postgres/9.2/Dockerfile @@ -52,9 +52,14 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/9.3/Dockerfile b/linux/ecosystem/postgres/9.3/Dockerfile index 782e711de..82076ba70 100644 --- a/linux/ecosystem/postgres/9.3/Dockerfile +++ b/linux/ecosystem/postgres/9.3/Dockerfile @@ -52,9 +52,14 @@ ENV PGDATA /var/lib/postgresql/data VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data -COPY ./docker-entrypoint.sh / +#healthcheck. good practice +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 -ENTRYPOINT ["/docker-entrypoint.sh"] +# Add image configuration and scripts +COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh +RUN chmod 755 /usr/bin/docker-entrypoint.sh + +ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/9.4/Dockerfile b/linux/ecosystem/postgres/9.4/Dockerfile index 8400dec43..f86ecbfda 100644 --- a/linux/ecosystem/postgres/9.4/Dockerfile +++ b/linux/ecosystem/postgres/9.4/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/9.5/Dockerfile b/linux/ecosystem/postgres/9.5/Dockerfile index 3bfcd9054..54c245186 100644 --- a/linux/ecosystem/postgres/9.5/Dockerfile +++ b/linux/ecosystem/postgres/9.5/Dockerfile @@ -54,14 +54,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/9.6/Dockerfile b/linux/ecosystem/postgres/9.6/Dockerfile index 49c89a171..990da2708 100644 --- a/linux/ecosystem/postgres/9.6/Dockerfile +++ b/linux/ecosystem/postgres/9.6/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any diff --git a/linux/ecosystem/postgres/latest/Dockerfile b/linux/ecosystem/postgres/latest/Dockerfile index 779b9c992..bdc6505ec 100644 --- a/linux/ecosystem/postgres/latest/Dockerfile +++ b/linux/ecosystem/postgres/latest/Dockerfile @@ -53,14 +53,13 @@ VOLUME /var/lib/postgresql/data WORKDIR /var/lib/postgresql/data #healthcheck. good practice -HEALTHCHECK --interval=2m --timeout=3s CMD pg_isready -h localhost -p 5433 || exit 1 +HEALTHCHECK --interval=3m --timeout=3s CMD pg_isready || exit 1 # Add image configuration and scripts COPY docker-entrypoint.sh /usr/bin/docker-entrypoint.sh RUN chmod 755 /usr/bin/docker-entrypoint.sh ENTRYPOINT ["tini", "-s", "--", "docker-entrypoint.sh"] -CMD ["docker-entrypoint.sh"] # We set the default STOPSIGNAL to SIGINT, which corresponds to what PostgreSQL # calls "Fast Shutdown mode" wherein new connections are disallowed and any