-
Notifications
You must be signed in to change notification settings - Fork 34
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1133 from uselagoon/add_postgres_17
build: add postgres-17 image
- Loading branch information
Showing
5 changed files
with
99 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/postgres-17 | ||
|
||
ARG LAGOON_VERSION | ||
ENV LAGOON_VERSION=$LAGOON_VERSION | ||
LABEL org.opencontainers.image.authors="The Lagoon Authors" | ||
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images/blob/main/images/postgres-drupal/17.Dockerfile" | ||
LABEL org.opencontainers.image.url="https://github.com/uselagoon/lagoon-images" | ||
LABEL org.opencontainers.image.version="${LAGOON_VERSION}" | ||
LABEL org.opencontainers.image.description="PostgreSQL 17 image optimised for Drupal workloads running in Lagoon in production and locally" | ||
LABEL org.opencontainers.image.title="uselagoon/postgres-17-drupal" | ||
LABEL org.opencontainers.image.base.name="docker.io/uselagoon/postgres-17" | ||
|
||
# change log_min_error_statement and log_min_messages from `error` to `log` as drupal is prone to cause some errors which are all logged (yes `log` is a less verbose mode than `error`) | ||
RUN sed -i "s/#log_min_error_statement = error/log_min_error_statement = log/" /usr/local/share/postgresql/postgresql.conf.sample \ | ||
&& sed -i "s/#log_min_messages = warning/log_min_messages = log/" /usr/local/share/postgresql/postgresql.conf.sample | ||
|
||
ENV POSTGRES_PASSWORD=drupal \ | ||
POSTGRES_USER=drupal \ | ||
POSTGRES_DB=drupal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/commons AS commons | ||
FROM postgres:17.0-alpine3.20 | ||
|
||
ARG LAGOON_VERSION | ||
ENV LAGOON_VERSION=$LAGOON_VERSION | ||
LABEL org.opencontainers.image.authors="The Lagoon Authors" | ||
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images/blob/main/images/postgres/17.Dockerfile" | ||
LABEL org.opencontainers.image.url="https://github.com/uselagoon/lagoon-images" | ||
LABEL org.opencontainers.image.version="${LAGOON_VERSION}" | ||
LABEL org.opencontainers.image.description="PostgreSQL 17 image optimised for running in Lagoon in production and locally" | ||
LABEL org.opencontainers.image.title="uselagoon/postgres-17" | ||
LABEL org.opencontainers.image.base.name="docker.io/postgres:17-alpine3.20" | ||
|
||
ENV LAGOON=postgres | ||
|
||
# Copy commons files | ||
COPY --from=commons /lagoon /lagoon | ||
COPY --from=commons /bin/fix-permissions /bin/ep /bin/docker-sleep /bin/wait-for /bin/ | ||
COPY --from=commons /sbin/tini /sbin/ | ||
COPY --from=commons /home /home | ||
|
||
ENV TMPDIR=/tmp \ | ||
TMP=/tmp \ | ||
HOME=/home \ | ||
# When Bash is invoked via `sh` it behaves like the old Bourne Shell and sources a file that is given in `ENV` | ||
ENV=/home/.bashrc \ | ||
# When Bash is invoked as non-interactive (like `bash -c command`) it sources a file that is given in `BASH_ENV` | ||
BASH_ENV=/home/.bashrc | ||
|
||
RUN apk update \ | ||
&& apk add --no-cache \ | ||
rsync \ | ||
tar \ | ||
&& rm -rf /var/cache/apk/* | ||
|
||
RUN fix-permissions /etc/passwd \ | ||
&& mkdir -p /home | ||
|
||
COPY postgres-backup.sh /lagoon/ | ||
|
||
RUN echo -e "local all all md5\nhost all all 0.0.0.0/0 md5" >> /usr/local/share/postgresql/pg_hba.conf | ||
|
||
ENV PGUSER=postgres \ | ||
POSTGRES_PASSWORD=lagoon \ | ||
POSTGRES_USER=lagoon \ | ||
POSTGRES_DB=lagoon \ | ||
PGDATA=/var/lib/postgresql/data/pgdata | ||
|
||
# Postgresql entrypoint file needs bash, so start the entrypoints with bash | ||
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.bash"] | ||
CMD ["/usr/local/bin/docker-entrypoint.sh", "postgres"] |