From 8008bb887971a68e79de8178a6aeec9812075deb Mon Sep 17 00:00:00 2001 From: Dmitry Date: Thu, 12 Dec 2024 15:20:25 +0200 Subject: [PATCH] new postgresql image --- .github/workflows/images.yml | 24 ------------------- .github/workflows/release.yml | 2 +- ci/pg13.Dockerfile | 44 ----------------------------------- ci/pg15.Dockerfile | 43 ---------------------------------- ci/pg16.Dockerfile | 8 +++---- 5 files changed, 5 insertions(+), 116 deletions(-) delete mode 100644 ci/pg13.Dockerfile delete mode 100644 ci/pg15.Dockerfile diff --git a/.github/workflows/images.yml b/.github/workflows/images.yml index c0cd8a052..a94bcea3e 100644 --- a/.github/workflows/images.yml +++ b/.github/workflows/images.yml @@ -53,30 +53,6 @@ jobs: push: true tags: ghcr.io/${{ github.repository_owner }}/yeti-web/build-image:bookworm - postgres-13-build-image: - name: Build Postgresql 13 images for CI - runs-on: ubuntu-latest - permissions: - packages: write - contents: read - steps: - - uses: actions/checkout@v4 - - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.repository_owner }} - password: ${{ secrets.GITHUB_TOKEN }} - - - name: Push db image - uses: docker/build-push-action@v5 - with: - context: . - file: ci/pg13.Dockerfile - push: true - tags: ghcr.io/${{ github.repository_owner }}/yeti-web/pgsql:13 - postgres-16-build-image: name: Build Postgresql 16 images for CI runs-on: ubuntu-latest diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 9e8409dfa..81a6f3f3c 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -11,7 +11,7 @@ jobs: container: ghcr.io/yeti-switch/yeti-web/build-image:bullseye services: db: - image: ghcr.io/yeti-switch/yeti-web/pgsql:13 + image: ghcr.io/yeti-switch/yeti-web/pgsql:16 steps: - uses: actions/checkout@v4 diff --git a/ci/pg13.Dockerfile b/ci/pg13.Dockerfile deleted file mode 100644 index 300ee9a74..000000000 --- a/ci/pg13.Dockerfile +++ /dev/null @@ -1,44 +0,0 @@ -FROM debian:bullseye - -ENV DEBIAN_FRONTEND=noninteractive -ENV LANG=C.UTF-8 -ENV PGVER=13 -ENV PGCONFIG=/etc/postgresql/$PGVER/main/postgresql.conf -RUN apt-get update && \ - apt-get -y dist-upgrade && \ - apt-get -y --no-install-recommends install curl gnupg ca-certificates - -RUN curl https://pkg.yeti-switch.org/key.gpg | apt-key add - && \ - curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - echo "deb http://pkg.yeti-switch.org/debian/bullseye 1.12 main" >> /etc/apt/sources.list && \ - echo "deb http://deb.debian.org/debian bullseye main contrib non-free" >> /etc/apt/sources.list && \ - echo "deb http://apt.postgresql.org/pub/repos/apt/ bullseye-pgdg main" >> /etc/apt/sources.list - -RUN apt-get update && \ - apt-get -y --no-install-recommends install \ - postgresql-$PGVER \ - postgresql-contrib-$PGVER \ - postgresql-$PGVER-prefix \ - postgresql-$PGVER-pgq3 \ - postgresql-$PGVER-pgq-ext \ - postgresql-$PGVER-pllua \ - postgresql-$PGVER-yeti - -RUN sed -Ei "/^#?listen_addresses +=/s/.*/listen_addresses = '*'/" "$PGCONFIG" && \ - sed -Ei "/^#?log_connections +=/s/.*/log_connections = on/" "$PGCONFIG" && \ - sed -Ei "/^#?log_disconnections +=/s/.*/log_disconnections = on/" "$PGCONFIG" && \ - sed -Ei "/^#?fsync +=/s/.*/fsync = off/" "$PGCONFIG" && \ - sed -Ei "/^#?synchronous_commit +=/s/.*/synchronous_commit = off/" "$PGCONFIG" && \ - sed -Ei "/^#?checkpoint_timeout +=/s/.*/checkpoint_timeout = 50min/" "$PGCONFIG" && \ - sed -Ei "/^#?ssl +=/s/.*/ssl = off/" "$PGCONFIG" && \ - sed -Ei "/^#?autovacuum +=/s/.*/autovacuum = off/" "$PGCONFIG" && \ - echo "shared_preload_libraries = 'yeti_pg_ext'" >> $PGCONFIG && \ - cat "$PGCONFIG" && \ - echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/$PGVER/main/pg_hba.conf && \ - echo "host all all ::/0 trust" >> /etc/postgresql/$PGVER/main/pg_hba.conf - -EXPOSE 5432 -USER postgres:postgres -ENTRYPOINT ["/usr/lib/postgresql/13/bin/postgres", \ - "-D", "/var/lib/postgresql/13/main", \ - "-c", "config_file=/etc/postgresql/13/main/postgresql.conf"] diff --git a/ci/pg15.Dockerfile b/ci/pg15.Dockerfile deleted file mode 100644 index feac7f5dd..000000000 --- a/ci/pg15.Dockerfile +++ /dev/null @@ -1,43 +0,0 @@ -FROM debian:bookworm - -ENV DEBIAN_FRONTEND=noninteractive -ENV LANG=C.UTF-8 -ENV PGVER=15 -ENV PGCONFIG=/etc/postgresql/$PGVER/main/postgresql.conf -RUN apt-get update && \ - apt-get -y dist-upgrade && \ - apt-get -y --no-install-recommends install curl gnupg ca-certificates - -RUN curl https://pkg.yeti-switch.org/key.gpg | apt-key add - && \ - curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - echo "deb http://pkg.yeti-switch.org/debian/bookworm 1.12 main" >> /etc/apt/sources.list && \ - echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" >> /etc/apt/sources.list - -RUN apt-get update && \ - apt-get -y --no-install-recommends install \ - postgresql-$PGVER \ - postgresql-contrib-$PGVER \ - postgresql-$PGVER-prefix \ - postgresql-$PGVER-pgq3 \ - postgresql-$PGVER-pgq-ext \ - postgresql-$PGVER-pllua \ - postgresql-$PGVER-yeti - -RUN sed -Ei "/^#?listen_addresses +=/s/.*/listen_addresses = '*'/" "$PGCONFIG" && \ - sed -Ei "/^#?log_connections +=/s/.*/log_connections = on/" "$PGCONFIG" && \ - sed -Ei "/^#?log_disconnections +=/s/.*/log_disconnections = on/" "$PGCONFIG" && \ - sed -Ei "/^#?fsync +=/s/.*/fsync = off/" "$PGCONFIG" && \ - sed -Ei "/^#?synchronous_commit +=/s/.*/synchronous_commit = off/" "$PGCONFIG" && \ - sed -Ei "/^#?checkpoint_timeout +=/s/.*/checkpoint_timeout = 50min/" "$PGCONFIG" && \ - sed -Ei "/^#?ssl +=/s/.*/ssl = off/" "$PGCONFIG" && \ - sed -Ei "/^#?autovacuum +=/s/.*/autovacuum = off/" "$PGCONFIG" && \ - echo "shared_preload_libraries = 'yeti_pg_ext'" >> $PGCONFIG && \ - cat "$PGCONFIG" && \ - echo "host all all 0.0.0.0/0 trust" >> /etc/postgresql/$PGVER/main/pg_hba.conf && \ - echo "host all all ::/0 trust" >> /etc/postgresql/$PGVER/main/pg_hba.conf - -EXPOSE 5432 -USER postgres:postgres -ENTRYPOINT ["/usr/lib/postgresql/15/bin/postgres", \ - "-D", "/var/lib/postgresql/15/main", \ - "-c", "config_file=/etc/postgresql/15/main/postgresql.conf"] diff --git a/ci/pg16.Dockerfile b/ci/pg16.Dockerfile index 1f574a058..5b632b907 100644 --- a/ci/pg16.Dockerfile +++ b/ci/pg16.Dockerfile @@ -8,10 +8,10 @@ RUN apt-get update && \ apt-get -y dist-upgrade && \ apt-get -y --no-install-recommends install curl gnupg ca-certificates -RUN curl https://pkg.yeti-switch.org/key.gpg | apt-key add - && \ - curl https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - && \ - echo "deb http://pkg.yeti-switch.org/debian/bookworm 1.12 main" >> /etc/apt/sources.list && \ - echo "deb http://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" >> /etc/apt/sources.list +RUN wget https://deb.yeti-switch.org/debian/yeti.gpg -O /etc/apt/trusted.gpg.d/yeti-key.asc && \ + wget https://www.postgresql.org/media/keys/ACCC4CF8.asc -O /etc/apt/trusted.gpg.d/pgdg-key.asc && \ + echo "deb https://deb.yeti-switch.org/debian/1.13 bookworm main" >> /etc/apt/sources.list && \ + echo "deb https://apt.postgresql.org/pub/repos/apt/ bookworm-pgdg main" >> /etc/apt/sources.list RUN apt-get update && \ apt-get -y --no-install-recommends install \