From e5b0fedfe6c7ef1e60fafbb70fa71926fe961131 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Tue, 14 Mar 2023 11:50:16 +0100 Subject: [PATCH 01/12] Maintenance: Switch to Zammad 5.4.0. (#328) --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 8591ddd7..f7407856 100644 --- a/.env +++ b/.env @@ -5,4 +5,4 @@ POSTGRES_PASS=zammad POSTGRES_USER=zammad REDIS_URL=redis://zammad-redis:6379 RESTART=always -VERSION=5.3.1-6 +VERSION=5.4.0 From 360324353f660b25db555d3e5c085007da3acc3a Mon Sep 17 00:00:00 2001 From: sdm216 <62703673+sdm216@users.noreply.github.com> Date: Wed, 12 Apr 2023 10:41:14 -0400 Subject: [PATCH 02/12] Update .env --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index f7407856..09b9f7de 100644 --- a/.env +++ b/.env @@ -5,4 +5,4 @@ POSTGRES_PASS=zammad POSTGRES_USER=zammad REDIS_URL=redis://zammad-redis:6379 RESTART=always -VERSION=5.4.0 +VERSION=5.4.1 From a8911b135904465cb1fc9bf790824b8cc92c37d4 Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Thu, 20 Apr 2023 08:20:57 +0200 Subject: [PATCH 03/12] Maintenance: Update README. --- README.md | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index ee80202c..6647e0e9 100644 --- a/README.md +++ b/README.md @@ -6,11 +6,14 @@ twitter, chat and emails. It is distributed under the GNU AFFERO General Public License (AGPL). Do you receive many emails and want to answer them with a team of agents? You're going to love Zammad! -## Use case for this repository +## Use cases -This repository is meant to be the starting point for somebody who likes to use dockerized multi-container Zammad in production. +This repository is the starting point if you want to: -## Getting started with zammad-docker-compose +- deploy Zammad in a containerized production environment +- test the current `stable` or `develop` versions of Zammad + +## Getting started [Learn more on Zammad’s documentation](https://docs.zammad.org/en/latest/install/docker-compose.html) @@ -18,8 +21,6 @@ This repository is meant to be the starting point for somebody who likes to use For upgrading instructions see our [Releases](https://github.com/zammad/zammad-docker-compose/releases). -Please be aware that the zammad-docker-compose repository versions and tags don't match the Zammad container tags! - ## Status [![ci-remote-image](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml/badge.svg)](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml) [![Docker Pulls](https://badgen.net/docker/pulls/zammad/zammad-docker-compose?icon=docker&label=pulls)](https://hub.docker.com/r/zammad/zammad-docker-compose/) @@ -48,4 +49,4 @@ RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up Elasticsearch is an optional, but strongly recommended dependency for Zammad. More details can be found in the [documentation](https://docs.zammad.org/en/latest/prerequisites/software.html#elasticsearch-optional). There are however certain scenarios when running without Elasticsearch may be desired, e.g. for very small teams, for teams with limited budget or as a temporary solution for an unplanned Elasticsearch downtime or planned cluster upgrade. -Elasticsearch is enabled by default in the example `docker-compose.yml` file. It is also by default required to run the "zammad-init" command. Disabling Elasticsearch is possible by setting a special environment variable: `ELASTICSEARCH_ENABLED=false` for the `zammad-init` container and removing all references to Elasticsearch everywhere else: the `zammad-elasticsearch` container, it's volume and links to it. +Elasticsearch is enabled by default in the example `docker-compose.yml` file. It is also by default required to run the "zammad-init" command. Disabling Elasticsearch is possible by setting a special environment variable: `ELASTICSEARCH_ENABLED=false` for the `zammad-init` container and removing all references to Elasticsearch everywhere else: the `zammad-elasticsearch` container, its volume and links to it. From ef8830e636e927dd3e220311cad35269bf5ad5f1 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 10 May 2023 13:14:45 +0200 Subject: [PATCH 04/12] Bump github/super-linter from 4 to 5 (#333) Bumps [github/super-linter](https://github.com/github/super-linter) from 4 to 5. - [Release notes](https://github.com/github/super-linter/releases) - [Changelog](https://github.com/github/super-linter/blob/main/docs/release-process.md) - [Commits](https://github.com/github/super-linter/compare/v4...v5) --- updated-dependencies: - dependency-name: github/super-linter dependency-type: direct:production update-type: version-update:semver-major ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/ci.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 85cce0d2..b892b3d7 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -23,7 +23,7 @@ jobs: fetch-depth: 0 - name: Lint Code Base - uses: github/super-linter/slim@v4 + uses: github/super-linter/slim@v5 env: DEFAULT_BRANCH: master GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} From 281b5f317f37a41d3e1827d9e266379a3886d442 Mon Sep 17 00:00:00 2001 From: Jensa Date: Fri, 12 May 2023 20:51:57 +0200 Subject: [PATCH 05/12] timed backup script with backup time (#339) * Update backup.sh - new zammad-timed-backup which uses fixed backup time $BACKUP_TIME * Update docker-compose.yml - $BACKUP_TIME added - timed backup as command * merge request and linting fixes * arithmetic linting fix * not related to merge request but fixes linting in check_railsserver_available --- docker-compose.yml | 3 ++- scripts/backup.sh | 11 ++++++++--- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 614a98bd..ed438f6c 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -10,10 +10,11 @@ services: - zammad-postgresql entrypoint: /usr/local/bin/backup.sh environment: - - BACKUP_SLEEP=86400 + - BACKUP_TIME=03:00 - HOLD_DAYS=10 - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASSWORD=${POSTGRES_PASS} + - TZ=Europe/Berlin image: postgres:${POSTGRES_VERSION} restart: ${RESTART} volumes: diff --git a/scripts/backup.sh b/scripts/backup.sh index 3874ed69..9821c181 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -11,7 +11,7 @@ set -e : "${POSTGRESQL_DB:=zammad_production}" function check_railsserver_available { - until (echo > /dev/tcp/${ZAMMAD_RAILSSERVER_HOST}/${ZAMMAD_RAILSSERVER_PORT}) &> /dev/null; do + until (echo > "/dev/tcp/$ZAMMAD_RAILSSERVER_HOST/$ZAMMAD_RAILSSERVER_PORT") &> /dev/null; do echo "waiting for railsserver to be ready..." sleep 60 done @@ -43,10 +43,15 @@ if [ "$1" = 'zammad-backup' ]; then check_railsserver_available while true; do + NOW_TIMESTAMP=$(date +%s) + TOMORROW_DATE=$(date -d@"$((NOW_TIMESTAMP + 24*60*60))" +%Y-%m-%d) + zammad_backup - # wait until next backup - sleep "${BACKUP_SLEEP}" + NEXT_TIMESTAMP=$(date -d "$TOMORROW_DATE $BACKUP_TIME" +%s) + NOW_TIMESTAMP=$(date +%s) + + sleep $((NEXT_TIMESTAMP - NOW_TIMESTAMP)) done fi From 1c5258909525c1ebfb23dc34fd080933e0d55993 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sun, 14 May 2023 13:23:10 +0200 Subject: [PATCH 06/12] update zammad to 5.4.1-29 (#340) --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 09b9f7de..d8bbf02a 100644 --- a/.env +++ b/.env @@ -5,4 +5,4 @@ POSTGRES_PASS=zammad POSTGRES_USER=zammad REDIS_URL=redis://zammad-redis:6379 RESTART=always -VERSION=5.4.1 +VERSION=5.4.1-29 From 9a547c67a9f365d368450f5060978261805ccd93 Mon Sep 17 00:00:00 2001 From: Jan Kiesewetter <3628035+t3easy@users.noreply.github.com> Date: Wed, 14 Jun 2023 11:36:01 +0200 Subject: [PATCH 07/12] Define database name (#343) Set the database name to the default of the Zammad image to avoid an unused database with the name of the POSTGRES_USER var. See default database name: https://github.com/zammad/zammad/blob/163377fc65585cff78f021b385faf8af2c964253/contrib/docker/docker-entrypoint.sh#L20 See PostgreSQL image documentation: https://hub.docker.com/_/postgres POSTGRES_DB This optional environment variable can be used to define a different name for the default database that is created when the image is first started. If it is not specified, then the value of POSTGRES_USER will be used. --- .env | 1 + docker-compose.yml | 3 +++ 2 files changed, 4 insertions(+) diff --git a/.env b/.env index d8bbf02a..9bc6cc73 100644 --- a/.env +++ b/.env @@ -3,6 +3,7 @@ MEMCACHE_SERVERS=zammad-memcached:11211 POSTGRES_VERSION=15.1-alpine POSTGRES_PASS=zammad POSTGRES_USER=zammad +POSTGRES_DB=zammad_production REDIS_URL=redis://zammad-redis:6379 RESTART=always VERSION=5.4.1-29 diff --git a/docker-compose.yml b/docker-compose.yml index ed438f6c..89080c77 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -14,6 +14,7 @@ services: - HOLD_DAYS=10 - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASSWORD=${POSTGRES_PASS} + - POSTGRESQL_DB=${POSTGRES_DB} - TZ=Europe/Berlin image: postgres:${POSTGRES_VERSION} restart: ${RESTART} @@ -36,6 +37,7 @@ services: - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASS=${POSTGRES_PASS} + - POSTGRESQL_DB=${POSTGRES_DB} - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:${VERSION} restart: on-failure @@ -62,6 +64,7 @@ services: environment: - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASS} + - POSTGRES_DB=${POSTGRES_DB} image: postgres:${POSTGRES_VERSION} restart: ${RESTART} volumes: From 3338cbeb22c824ffd3ccbc126733e3e50e12388d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 14 Jun 2023 13:27:25 +0200 Subject: [PATCH 08/12] sort vars (#351) --- docker-compose.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docker-compose.yml b/docker-compose.yml index 89080c77..8f0836d5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -12,9 +12,9 @@ services: environment: - BACKUP_TIME=03:00 - HOLD_DAYS=10 + - POSTGRESQL_DB=${POSTGRES_DB} - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASSWORD=${POSTGRES_PASS} - - POSTGRESQL_DB=${POSTGRES_DB} - TZ=Europe/Berlin image: postgres:${POSTGRES_VERSION} restart: ${RESTART} @@ -35,9 +35,9 @@ services: - zammad-postgresql environment: - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} + - POSTGRESQL_DB=${POSTGRES_DB} - POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_PASS=${POSTGRES_PASS} - - POSTGRESQL_DB=${POSTGRES_DB} - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:${VERSION} restart: on-failure @@ -62,9 +62,9 @@ services: zammad-postgresql: environment: + - POSTGRES_DB=${POSTGRES_DB} - POSTGRES_USER=${POSTGRES_USER} - POSTGRES_PASSWORD=${POSTGRES_PASS} - - POSTGRES_DB=${POSTGRES_DB} image: postgres:${POSTGRES_VERSION} restart: ${RESTART} volumes: From ffa1268a2aab5b459b255c63e004b011117b3c0f Mon Sep 17 00:00:00 2001 From: Martin Gruner Date: Wed, 21 Jun 2023 16:05:23 +0200 Subject: [PATCH 09/12] Update to Zammad 6.0. (#347) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Update to Zammad 6.0. * adjust compose and env / change docker registry Signed-off-by: André Bauer --------- Signed-off-by: André Bauer Co-authored-by: André Bauer --- .env | 13 +++++++--- .github/tests.sh | 16 ++++++++++-- .github/workflows/ci-remote-image.yaml | 2 +- docker-compose.yml | 34 +++++++++++++++----------- scripts/backup.sh | 2 +- 5 files changed, 45 insertions(+), 22 deletions(-) diff --git a/.env b/.env index 9bc6cc73..0ee4b1be 100644 --- a/.env +++ b/.env @@ -1,9 +1,14 @@ -IMAGE_REPO=zammad/zammad-docker-compose +ELASTICSEARCH_VERSION=8.8.0 +IMAGE_REPO=ghcr.io/zammad/zammad MEMCACHE_SERVERS=zammad-memcached:11211 -POSTGRES_VERSION=15.1-alpine +MEMCACHE_VERSION=1.6.20-alpine +POSTGRES_DB=zammad_production POSTGRES_PASS=zammad POSTGRES_USER=zammad -POSTGRES_DB=zammad_production +POSTGRES_HOST=zammad-postgresql +POSTGRES_PORT=5432 +POSTGRES_VERSION=15.3-alpine REDIS_URL=redis://zammad-redis:6379 +REDIS_VERSION=7.0.5-alpine RESTART=always -VERSION=5.4.1-29 +VERSION=6.0.0-27 diff --git a/.github/tests.sh b/.github/tests.sh index 96fafc0b..bfd2337d 100755 --- a/.github/tests.sh +++ b/.github/tests.sh @@ -23,16 +23,28 @@ echo echo "Execute autowizard..." echo -docker exec zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard +docker exec --env=AUTOWIZARD_RELATIVE_PATH=var/auto_wizard.json --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard echo echo "Autowizard executed successful :)" echo +echo +echo "Check DB for AutoWizard user" +echo + +docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rails r "p User.find_by(email: 'info@zammad.org')" | grep 'info@zammad.org' + +echo +echo "Check DB for AutoWizard user successfull :)" +echo + echo echo "Fill DB with some random data" -docker exec zammad-docker-compose_zammad-railsserver_1 rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" +echo + +docker exec --env=DATABASE_URL=postgres://zammad:zammad@zammad-postgresql:5432/zammad_production zammad-docker-compose_zammad-railsserver_1 rails r "FillDb.load(agents: 1,customers: 1,groups: 1,organizations: 1,overviews: 1,tickets: 1)" echo echo "DB fill successful :)" diff --git a/.github/workflows/ci-remote-image.yaml b/.github/workflows/ci-remote-image.yaml index e57f5c7c..585affe9 100644 --- a/.github/workflows/ci-remote-image.yaml +++ b/.github/workflows/ci-remote-image.yaml @@ -19,7 +19,7 @@ jobs: run: docker-compose up --detach - name: add autowizard file - run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad + run: docker cp .github/auto_wizard.json zammad-docker-compose_zammad-railsserver_1:/opt/zammad/var - name: run tests run: .github/tests.sh diff --git a/docker-compose.yml b/docker-compose.yml index 8f0836d5..b1640d04 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -1,5 +1,5 @@ --- -version: '3' +version: '3.8' services: @@ -20,11 +20,11 @@ services: restart: ${RESTART} volumes: - zammad-backup:/var/tmp/zammad - - zammad-data:/opt/zammad:ro + - zammad-var:/opt/zammad/var:ro - ./scripts/backup.sh:/usr/local/bin/backup.sh:ro zammad-elasticsearch: - image: bitnami/elasticsearch:8.5.1 + image: bitnami/elasticsearch:${ELASTICSEARCH_VERSION} restart: ${RESTART} volumes: - elasticsearch-data:/bitnami/elasticsearch/data @@ -35,18 +35,17 @@ services: - zammad-postgresql environment: - MEMCACHE_SERVERS=${MEMCACHE_SERVERS} - - POSTGRESQL_DB=${POSTGRES_DB} - - POSTGRESQL_USER=${POSTGRES_USER} - - POSTGRESQL_PASS=${POSTGRES_PASS} - REDIS_URL=${REDIS_URL} image: ${IMAGE_REPO}:${VERSION} restart: on-failure + user: 0:0 volumes: - - zammad-data:/opt/zammad + - zammad-config-nginx:/etc/nginx/sites-enabled + - zammad-var:/opt/zammad/var zammad-memcached: command: memcached -m 256M - image: memcached:1.6.17-alpine + image: memcached:${MEMCACHE_VERSION} restart: ${RESTART} zammad-nginx: @@ -58,7 +57,8 @@ services: image: ${IMAGE_REPO}:${VERSION} restart: ${RESTART} volumes: - - zammad-data:/opt/zammad + - zammad-config-nginx:/etc/nginx/sites-enabled:ro + - zammad-var:/opt/zammad/var:ro zammad-postgresql: environment: @@ -82,11 +82,13 @@ services: image: ${IMAGE_REPO}:${VERSION} restart: ${RESTART} volumes: - - zammad-data:/opt/zammad + - zammad-var:/opt/zammad/var zammad-redis: - image: redis:7.0.5-alpine + image: redis:${REDIS_VERSION} restart: ${RESTART} + volumes: + - redis-data:/data zammad-scheduler: command: ["zammad-scheduler"] @@ -100,7 +102,7 @@ services: image: ${IMAGE_REPO}:${VERSION} restart: ${RESTART} volumes: - - zammad-data:/opt/zammad + - zammad-var:/opt/zammad/var zammad-websocket: command: ["zammad-websocket"] @@ -114,14 +116,18 @@ services: image: ${IMAGE_REPO}:${VERSION} restart: ${RESTART} volumes: - - zammad-data:/opt/zammad + - zammad-var:/opt/zammad/var volumes: elasticsearch-data: driver: local postgresql-data: driver: local + redis-data: + driver: local zammad-backup: driver: local - zammad-data: + zammad-config-nginx: + driver: local + zammad-var: driver: local diff --git a/scripts/backup.sh b/scripts/backup.sh index 9821c181..6256374e 100755 --- a/scripts/backup.sh +++ b/scripts/backup.sh @@ -2,7 +2,7 @@ set -e -: "${ZAMMAD_DIR:=/opt/zammad}" +: "${ZAMMAD_DIR:=/opt/zammad/var}" : "${BACKUP_DIR:=/var/tmp/zammad}" : "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}" : "${ZAMMAD_RAILSSERVER_PORT:=3000}" From 662aa8f512576f3755e108b4ba13fe22fb95e3a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Wed, 21 Jun 2023 16:27:42 +0200 Subject: [PATCH 10/12] update dockerhub pulls badge (#352) --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 6647e0e9..4d3fab8e 100644 --- a/README.md +++ b/README.md @@ -23,7 +23,7 @@ For upgrading instructions see our [Releases](https://github.com/zammad/zammad-d ## Status -[![ci-remote-image](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml/badge.svg)](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml) [![Docker Pulls](https://badgen.net/docker/pulls/zammad/zammad-docker-compose?icon=docker&label=pulls)](https://hub.docker.com/r/zammad/zammad-docker-compose/) +[![ci-remote-image](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml/badge.svg)](https://github.com/zammad/zammad-docker-compose/actions/workflows/ci-remote-image.yaml) [![Dockerhub Pulls](https://badgen.net/docker/pulls/zammad/zammad-docker-compose?icon=docker&label=pulls)](https://hub.docker.com/r/zammad/zammad-docker-compose/) ## Using a reverse proxy From 6606e8e2cadc6c70be95ccc5eabeca5e0c5bda8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Thu, 22 Jun 2023 20:16:10 +0200 Subject: [PATCH 11/12] update zammad to 6.0.0-32 (#353) --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 0ee4b1be..5db57fc2 100644 --- a/.env +++ b/.env @@ -11,4 +11,4 @@ POSTGRES_VERSION=15.3-alpine REDIS_URL=redis://zammad-redis:6379 REDIS_VERSION=7.0.5-alpine RESTART=always -VERSION=6.0.0-27 +VERSION=6.0.0-32 From 799edd78631e0a4c871e58d151fbdac3f4b2c95c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 18 Jul 2023 18:47:20 +0200 Subject: [PATCH 12/12] Update zammad to 6.0.0-66 (#363) --- .env | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.env b/.env index 5db57fc2..7db514f1 100644 --- a/.env +++ b/.env @@ -11,4 +11,4 @@ POSTGRES_VERSION=15.3-alpine REDIS_URL=redis://zammad-redis:6379 REDIS_VERSION=7.0.5-alpine RESTART=always -VERSION=6.0.0-32 +VERSION=6.0.0-66