* 'master' of https://github.com/zammad/zammad-docker-compose:
  update zammad version & made es reindex optional (#175)
  updated memcached image
  Maintenance: Updated ruby dependency from 2.6.5 to 2.6.6.
  Fix as recommended here: https://github.com/zammad/zammad-docker-compose/issues/168#issuecomment-659505704 (#172)
  Allow starting without Elasticsearch. (#171)
  update es (#170)
This commit is contained in:
Ross Crawford-d'Heureuse 2020-10-01 09:12:40 +02:00
commit 6b896baba8
8 changed files with 46 additions and 31 deletions

2
.env
View File

@ -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

View File

@ -4,6 +4,7 @@ services:
zammad-nginx:
environment:
- VIRTUAL_HOST=helpdesk.domain.tld
- NGINX_SERVER_SCHEME=https
networks:
- default
- proxy_2_zammad

View File

@ -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

View File

@ -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"]

View File

@ -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"]

View File

@ -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

View File

@ -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

View File

@ -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: