Browse Source

Fixes: zammad-backup not working with postgres 17 (zammad-docker-compose/issues/440)

Martin Gruner 3 months ago
parent
commit
1fc100e282
4 changed files with 15 additions and 7 deletions
  1. 1 0
      .github/workflows/docker-ci.yaml
  2. 1 0
      .github/workflows/docker-release.yaml
  3. 3 3
      Dockerfile
  4. 10 4
      contrib/docker/setup.sh

+ 1 - 0
.github/workflows/docker-ci.yaml

@@ -29,6 +29,7 @@ jobs:
         with:
           context: .
           labels: ${{ steps.meta.outputs.labels }}
+          pull: true
           push: false
           tags: ${{ steps.meta.outputs.tags }}
           outputs: type=docker,dest=/tmp/zammad-local.tar

+ 1 - 0
.github/workflows/docker-release.yaml

@@ -65,6 +65,7 @@ jobs:
         with:
           context: .
           labels: ${{ steps.meta.outputs.labels }}
+          pull: true
           push: true
           tags: ${{ steps.meta.outputs.tags }}
 

+ 3 - 3
Dockerfile

@@ -1,9 +1,9 @@
-FROM node:20-slim AS node
+FROM node:20-bookworm-slim AS node
 RUN npm -g install pnpm
 RUN rm /usr/local/bin/yarn /usr/local/bin/yarnpkg
 
 
-FROM ruby:3.2.4-slim AS builder
+FROM ruby:3.2.4-slim-bookworm AS builder
 ARG DEBIAN_FRONTEND=noninteractive
 ARG RAILS_ENV=production
 ARG ZAMMAD_DIR=/opt/zammad
@@ -17,7 +17,7 @@ RUN contrib/docker/setup.sh builder
 
 # note: zammad is currently incompatible to alpine because of:
 # https://github.com/docker-library/ruby/issues/113
-FROM ruby:3.2.4-slim
+FROM ruby:3.2.4-slim-bookworm
 ARG DEBIAN_FRONTEND=noninteractive
 ARG ZAMMAD_USER=zammad
 ENV RAILS_ENV=production

+ 10 - 4
contrib/docker/setup.sh

@@ -1,14 +1,20 @@
 #!/usr/bin/env bash
 set -e
 
+apt-get update
+apt-get upgrade -y
+
+# Add official PostgreSQL apt repository to not depend on Debian's version.
+#   https://www.postgresql.org/download/linux/debian/
+apt-get install -y postgresql-common
+/usr/share/postgresql-common/pgdg/apt.postgresql.org.sh -y
+
 if [ "$1" = 'builder' ]; then
-  PACKAGES="build-essential curl git libimlib2-dev libpq-dev shared-mime-info postgresql"
+  PACKAGES="build-essential curl git libimlib2-dev libpq-dev shared-mime-info postgresql-17"
 elif [ "$1" = 'runner' ]; then
-  PACKAGES="curl libimlib2 libpq5 nginx gnupg postgresql-client"
+  PACKAGES="curl libimlib2 libpq5 nginx gnupg postgresql-client-17"
 fi
 
-apt-get update
-apt-get upgrade -y
 # shellcheck disable=SC2086
 apt-get install -y --no-install-recommends ${PACKAGES}
 rm -rf /var/lib/apt/lists/*