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/.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 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-elasticsearch/Dockerfile b/containers/zammad-elasticsearch/Dockerfile index 8a7a417..b9e5dd4 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" \ @@ -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 a78dd59..22276bc 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 @@ -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 694d711..355fa76 100755 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -3,10 +3,12 @@ set -e : "${AUTOWIZARD_JSON:=''}" +: "${ELASTICSEARCH_ENABLED:=true}" : "${ELASTICSEARCH_HOST:=zammad-elasticsearch}" : "${ELASTICSEARCH_PORT:=9200}" : "${ELASTICSEARCH_SCHEMA:=http}" : "${ELASTICSEARCH_NAMESPACE:=zammad}" +: "${ELASTICSEARCH_REINDEX:=true}" : "${ELASTICSEARCH_SSL_VERIFY:=true}" : "${MEMCACHED_HOST:=zammad-memcached}" : "${MEMCACHED_PORT:=11211}" @@ -74,32 +76,38 @@ 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 [ "${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 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: