-
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 #864 from uselagoon/py_pgsql_images
Add python-3.12 and postgres-16 images
- Loading branch information
Showing
8 changed files
with
146 additions
and
7 deletions.
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
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,13 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/postgres-16 | ||
|
||
LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors" | ||
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images" | ||
|
||
# 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,42 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/commons as commons | ||
FROM postgres:16.0-alpine3.18 | ||
|
||
LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors" | ||
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images" | ||
|
||
ARG LAGOON_VERSION | ||
ENV LAGOON_VERSION=$LAGOON_VERSION | ||
|
||
# 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 fix-permissions /etc/passwd \ | ||
&& mkdir -p /home | ||
|
||
ENV LAGOON=postgres | ||
|
||
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"] |
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,40 @@ | ||
ARG IMAGE_REPO | ||
FROM ${IMAGE_REPO:-lagoon}/commons as commons | ||
|
||
FROM python:3.12.0-alpine3.18 | ||
|
||
LABEL org.opencontainers.image.authors="The Lagoon Authors" maintainer="The Lagoon Authors" | ||
LABEL org.opencontainers.image.source="https://github.com/uselagoon/lagoon-images" repository="https://github.com/uselagoon/lagoon-images" | ||
|
||
ENV LAGOON=python | ||
|
||
# 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 | ||
|
||
RUN fix-permissions /etc/passwd \ | ||
&& mkdir -p /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 add --no-cache --virtual .build-deps \ | ||
build-base \ | ||
&& pip install --upgrade pip \ | ||
&& pip install virtualenv \ | ||
&& apk del \ | ||
.build-deps | ||
|
||
# Make sure shells are not running forever | ||
COPY 80-shell-timeout.sh /lagoon/entrypoints/ | ||
RUN echo "source /lagoon/entrypoints/80-shell-timeout.sh" >> /home/.bashrc | ||
|
||
ENTRYPOINT ["/sbin/tini", "--", "/lagoon/entrypoints.sh"] | ||
CMD ["python"] |