From 83438a63a4d1b44274410dc3834b51c50bc36e50 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Fri, 4 Sep 2020 15:27:06 +0200 Subject: [PATCH 1/6] update es (#170) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- containers/zammad-elasticsearch/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/containers/zammad-elasticsearch/Dockerfile b/containers/zammad-elasticsearch/Dockerfile index 8a7a417..901ff79 100644 --- a/containers/zammad-elasticsearch/Dockerfile +++ b/containers/zammad-elasticsearch/Dockerfile @@ -1,4 +1,4 @@ -FROM docker.elastic.co/elasticsearch/elasticsearch:7.6.1 +FROM docker.elastic.co/elasticsearch/elasticsearch:7.9.1 ARG BUILD_DATE LABEL org.label-schema.build-date="$BUILD_DATE" \ From cf3fd9c090b627ff5f782118b011747bb88d4bcc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Goc=C5=82awski?= Date: Mon, 14 Sep 2020 16:11:41 +0200 Subject: [PATCH 2/6] Allow starting without Elasticsearch. (#171) * Allow starting without Elasticsearch. * Document running without Elasticsearch in the README.md. --- README.md | 6 +++ containers/zammad/docker-entrypoint.sh | 51 ++++++++++++++------------ 2 files changed, 34 insertions(+), 23 deletions(-) diff --git a/README.md b/README.md index abba102..8d26cef 100644 --- a/README.md +++ b/README.md @@ -40,6 +40,12 @@ Like this, you can add your `docker-compose.prod.yml` to a branch of your Git re * RANCHER_URL=http://RANCHER_HOST:8080 rancher-compose --env-file=.env up +## Running without Elasticsearch + +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. + ## Upgrading ### From =< 3.3.0-12 diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index 694d711..d33cca5 100755 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -3,6 +3,7 @@ set -e : "${AUTOWIZARD_JSON:=''}" +: "${ELASTICSEARCH_ENABLED:=true}" : "${ELASTICSEARCH_HOST:=zammad-elasticsearch}" : "${ELASTICSEARCH_PORT:=9200}" : "${ELASTICSEARCH_SCHEMA:=http}" @@ -74,32 +75,36 @@ if [ "$1" = 'zammad-init' ]; then else bundle exec rake db:migrate fi - + # es config echo "changing settings..." - bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')" - - bundle exec rails r "Setting.set('es_index', '${ELASTICSEARCH_NAMESPACE}')" - - if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then - bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")" - bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")" - fi - - until (echo > /dev/tcp/${ELASTICSEARCH_HOST}/${ELASTICSEARCH_PORT}) &> /dev/null; do - echo "zammad railsserver waiting for elasticsearch server to be ready..." - sleep 5 - done - - if [ "${ELASTICSEARCH_SSL_VERIFY}" == "false" ]; then - SSL_SKIP_VERIFY="-k" + if [ "${ELASTICSEARCH_ENABLED}" == "false" ]; then + bundle exec rails r "Setting.set('es_url', '')" else - SSL_SKIP_VERIFY="" - fi - - if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then - echo "rebuilding es searchindex..." - bundle exec rake searchindex:rebuild + bundle exec rails r "Setting.set('es_url', '${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}')" + + bundle exec rails r "Setting.set('es_index', '${ELASTICSEARCH_NAMESPACE}')" + + if [ -n "${ELASTICSEARCH_USER}" ] && [ -n "${ELASTICSEARCH_PASS}" ]; then + bundle exec rails r "Setting.set('es_user', \"${ELASTICSEARCH_USER}\")" + bundle exec rails r "Setting.set('es_password', \"${ELASTICSEARCH_PASS}\")" + fi + + until (echo > /dev/tcp/${ELASTICSEARCH_HOST}/${ELASTICSEARCH_PORT}) &> /dev/null; do + echo "zammad railsserver waiting for elasticsearch server to be ready..." + sleep 5 + done + + if [ "${ELASTICSEARCH_SSL_VERIFY}" == "false" ]; then + SSL_SKIP_VERIFY="-k" + else + SSL_SKIP_VERIFY="" + fi + + if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then + echo "rebuilding es searchindex..." + bundle exec rake searchindex:rebuild + fi fi # chown everything to zammad user From d2e5fbb4a5276ceaa5372a4440f3b94e6cd3c2f0 Mon Sep 17 00:00:00 2001 From: Jensa Date: Sat, 19 Sep 2020 00:17:46 +0200 Subject: [PATCH 3/6] Fix as recommended here: https://github.com/zammad/zammad-docker-compose/issues/168#issuecomment-659505704 (#172) --- .examples/proxy/docker-compose.proxy-example.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.examples/proxy/docker-compose.proxy-example.yml b/.examples/proxy/docker-compose.proxy-example.yml index d562911..31f2747 100644 --- a/.examples/proxy/docker-compose.proxy-example.yml +++ b/.examples/proxy/docker-compose.proxy-example.yml @@ -4,6 +4,7 @@ services: zammad-nginx: environment: - VIRTUAL_HOST=helpdesk.domain.tld + - NGINX_SERVER_SCHEME=https networks: - default - proxy_2_zammad From 9f79620f9e03d7d3b102d62397f79f569fa67f56 Mon Sep 17 00:00:00 2001 From: Thorsten Eckel Date: Tue, 22 Sep 2020 13:42:13 +0200 Subject: [PATCH 4/6] Maintenance: Updated ruby dependency from 2.6.5 to 2.6.6. --- containers/zammad/Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/containers/zammad/Dockerfile b/containers/zammad/Dockerfile index a78dd59..d7992d2 100644 --- a/containers/zammad/Dockerfile +++ b/containers/zammad/Dockerfile @@ -1,4 +1,4 @@ -FROM ruby:2.6.5-slim AS builder +FROM ruby:2.6.6-slim AS builder # note: zammad is currently incompatible to alpine because of: # https://github.com/docker-library/ruby/issues/113 @@ -24,7 +24,7 @@ RUN chmod +x /tmp/setup.sh; \ /tmp/setup.sh install -FROM ruby:2.6.5-slim +FROM ruby:2.6.6-slim ARG BUILD_DATE ARG DEBIAN_FRONTEND=noninteractive From 297c3f8004be6a5657ff74d49c439d6aa3820a1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Thu, 24 Sep 2020 18:23:02 +0200 Subject: [PATCH 5/6] updated memcached image --- docker-compose.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker-compose.yml b/docker-compose.yml index 59909c2..72a76c4 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -45,7 +45,7 @@ services: zammad-memcached: command: memcached -m 256M - image: memcached:1.5.22-alpine + image: memcached:1.6.7-alpine restart: ${RESTART} zammad-nginx: From 7d15c4909a777642ce96f3cde9ff5c937422f8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Fri, 25 Sep 2020 14:35:49 +0200 Subject: [PATCH 6/6] update zammad version & made es reindex optional (#175) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: André Bauer --- .env | 2 +- containers/zammad-elasticsearch/Dockerfile | 2 +- containers/zammad-postgresql/Dockerfile | 2 +- containers/zammad/Dockerfile | 2 +- containers/zammad/docker-entrypoint.sh | 11 +++++++---- 5 files changed, 11 insertions(+), 8 deletions(-) diff --git a/.env b/.env index b013eff..65a53d9 100644 --- a/.env +++ b/.env @@ -3,4 +3,4 @@ POSTGRES_PASS=zammad POSTGRES_USER=zammad RESTART=always # don't forget to add the minus before the version -VERSION=-3.4.0-4 +VERSION=-3.5.0-2 diff --git a/containers/zammad-elasticsearch/Dockerfile b/containers/zammad-elasticsearch/Dockerfile index 901ff79..b9e5dd4 100644 --- a/containers/zammad-elasticsearch/Dockerfile +++ b/containers/zammad-elasticsearch/Dockerfile @@ -9,7 +9,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/zammad/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="Zammad" \ - org.label-schema.schema-version="3.4.0" \ + org.label-schema.schema-version="3.5.0" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] diff --git a/containers/zammad-postgresql/Dockerfile b/containers/zammad-postgresql/Dockerfile index 9694b99..298df22 100644 --- a/containers/zammad-postgresql/Dockerfile +++ b/containers/zammad-postgresql/Dockerfile @@ -10,7 +10,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/zammad/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="Zammad" \ - org.label-schema.schema-version="3.4.0" \ + org.label-schema.schema-version="3.5.0" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" SHELL ["/bin/bash", "-e", "-o", "pipefail", "-c"] diff --git a/containers/zammad/Dockerfile b/containers/zammad/Dockerfile index d7992d2..22276bc 100644 --- a/containers/zammad/Dockerfile +++ b/containers/zammad/Dockerfile @@ -37,7 +37,7 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.vcs-url="https://github.com/zammad/zammad" \ org.label-schema.vcs-type="Git" \ org.label-schema.vendor="Zammad" \ - org.label-schema.schema-version="3.4.0" \ + org.label-schema.schema-version="3.5.0" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" ENV GIT_BRANCH stable diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index d33cca5..355fa76 100755 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -8,6 +8,7 @@ set -e : "${ELASTICSEARCH_PORT:=9200}" : "${ELASTICSEARCH_SCHEMA:=http}" : "${ELASTICSEARCH_NAMESPACE:=zammad}" +: "${ELASTICSEARCH_REINDEX:=true}" : "${ELASTICSEARCH_SSL_VERIFY:=true}" : "${MEMCACHED_HOST:=zammad-memcached}" : "${MEMCACHED_PORT:=11211}" @@ -101,10 +102,12 @@ if [ "$1" = 'zammad-init' ]; then SSL_SKIP_VERIFY="" fi - if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then - echo "rebuilding es searchindex..." - bundle exec rake searchindex:rebuild - fi + if [ "${ELASTICSEARCH_REINDEX}" == "true" ]; then + if ! curl -s ${SSL_SKIP_VERIFY} ${ELASTICSEARCH_SCHEMA}://${ELASTICSEARCH_HOST}:${ELASTICSEARCH_PORT}/_cat/indices | grep -q zammad; then + echo "rebuilding es searchindex..." + bundle exec rake searchindex:rebuild + fi + fi fi # chown everything to zammad user