Changes for Zammad 5 (#219)

* FillDB was renamed to FillDb for Zammad 5.

* Changed Ruby dependency to 2.7.3.

* Update containers/zammad/Dockerfile

* added redis / changed memcached

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* update memcached

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix image

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* remove nginx duplicate

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added nodejs

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* added cache clear and removed links

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

* fix typo

Signed-off-by: André Bauer <andre.bauer@staffbase.com>

Co-authored-by: André Bauer <monotek@users.noreply.github.com>
Co-authored-by: André Bauer <andre.bauer@staffbase.com>
This commit is contained in:
Martin Gruner 2021-10-05 21:25:26 +02:00 committed by GitHub
parent db7ca4b92d
commit 9aad202b60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 26 additions and 34 deletions

10
.github/tests.sh vendored
View File

@ -19,20 +19,20 @@ echo
echo "Success - Zammad is up :)" echo "Success - Zammad is up :)"
echo echo
echo echo
echo "Execute autowizard..." echo "Execute autowizard..."
echo echo
docker exec zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard docker exec zammad-docker-compose_zammad-railsserver_1 rake zammad:setup:auto_wizard
echo echo
echo "Autowizard executed successful :)" echo "Autowizard executed successful :)"
echo echo
echo echo
echo "Fill DB with some random data" 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)" 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 echo
echo "DB fill successful :)" echo "DB fill successful :)"

View File

@ -75,3 +75,8 @@ ALTER USER zammad WITH SUPERUSER CREATEDB;
To be able to run Zammad container with an unprivileged user we had to change the port Nginx uses from 80 to 8080, so Zammad needs to be accessed via <http://localhost:8080> instead of <http://localhost> now! To be able to run Zammad container with an unprivileged user we had to change the port Nginx uses from 80 to 8080, so Zammad needs to be accessed via <http://localhost:8080> instead of <http://localhost> now!
This change will also affect you, if you use a reverse proxy, like Traefik or Haproxy, in front of Zammad as your reverse proxy configuration needs to be adapted to point to port 8080 now. This change will also affect you, if you use a reverse proxy, like Traefik or Haproxy, in front of Zammad as your reverse proxy configuration needs to be adapted to point to port 8080 now.
### From =< 4.0.0 to 5.0.0
Memchached config changed. If you use the old env vars `MEMCACHED_HOST` & `MEMCACHED_PORT` adapt to `MEMCACHE_SERVERS`.
Redis is a dependency for the Websocket server now.

View File

@ -1,6 +1,6 @@
FROM ruby:2.6.8-slim AS builder
# note: zammad is currently incompatible to alpine because of: # note: zammad is currently incompatible to alpine because of:
# https://github.com/docker-library/ruby/issues/113 # https://github.com/docker-library/ruby/issues/113
FROM ruby:2.7.4-slim AS builder
ARG BUILD_DATE ARG BUILD_DATE
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive
@ -24,7 +24,7 @@ RUN chmod +x /tmp/setup.sh; \
/tmp/setup.sh builder /tmp/setup.sh builder
FROM ruby:2.6.8-slim FROM ruby:2.7.4-slim
ARG BUILD_DATE ARG BUILD_DATE
ARG DEBIAN_FRONTEND=noninteractive ARG DEBIAN_FRONTEND=noninteractive

View File

@ -10,8 +10,7 @@ set -e
: "${ELASTICSEARCH_NAMESPACE:=zammad}" : "${ELASTICSEARCH_NAMESPACE:=zammad}"
: "${ELASTICSEARCH_REINDEX:=true}" : "${ELASTICSEARCH_REINDEX:=true}"
: "${ELASTICSEARCH_SSL_VERIFY:=true}" : "${ELASTICSEARCH_SSL_VERIFY:=true}"
: "${MEMCACHED_HOST:=zammad-memcached}" : "${MEMCACHE_SERVERS:=zammad-memcached:11211}"
: "${MEMCACHED_PORT:=11211}"
: "${NGINX_PORT:=8080}" : "${NGINX_PORT:=8080}"
: "${NGINX_SERVER_NAME:=_}" : "${NGINX_SERVER_NAME:=_}"
: "${NGINX_SERVER_SCHEME:=\$scheme}" : "${NGINX_SERVER_SCHEME:=\$scheme}"
@ -22,6 +21,7 @@ set -e
: "${POSTGRESQL_DB:=zammad_production}" : "${POSTGRESQL_DB:=zammad_production}"
: "${POSTGRESQL_DB_CREATE:=true}" : "${POSTGRESQL_DB_CREATE:=true}"
: "${RAILS_TRUSTED_PROXIES:=['127.0.0.1', '::1']}" : "${RAILS_TRUSTED_PROXIES:=['127.0.0.1', '::1']}"
: "${REDIS_URL:=redis://zammad-redis:6379}"
: "${RSYNC_ADDITIONAL_PARAMS:=--no-perms --no-owner}" : "${RSYNC_ADDITIONAL_PARAMS:=--no-perms --no-owner}"
: "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}" : "${ZAMMAD_RAILSSERVER_HOST:=zammad-railsserver}"
: "${ZAMMAD_RAILSSERVER_PORT:=3000}" : "${ZAMMAD_RAILSSERVER_PORT:=3000}"
@ -58,9 +58,6 @@ if [ "$1" = 'zammad-init' ]; then
ESCAPED_POSTGRESQL_PASS=$(echo "$POSTGRESQL_PASS" | sed -e 's/[\/&]/\\&/g') ESCAPED_POSTGRESQL_PASS=$(echo "$POSTGRESQL_PASS" | sed -e 's/[\/&]/\\&/g')
sed -e "s#.*adapter:.*# adapter: postgresql#g" -e "s#.*database:.*# database: ${POSTGRESQL_DB}#g" -e "s#.*username:.*# username: ${POSTGRESQL_USER}#g" -e "s#.*password:.*# password: ${ESCAPED_POSTGRESQL_PASS}\\n host: ${POSTGRESQL_HOST}\\n port: ${POSTGRESQL_PORT}#g" < contrib/packager.io/database.yml.pkgr > config/database.yml sed -e "s#.*adapter:.*# adapter: postgresql#g" -e "s#.*database:.*# database: ${POSTGRESQL_DB}#g" -e "s#.*username:.*# username: ${POSTGRESQL_USER}#g" -e "s#.*password:.*# password: ${ESCAPED_POSTGRESQL_PASS}\\n host: ${POSTGRESQL_HOST}\\n port: ${POSTGRESQL_PORT}#g" < contrib/packager.io/database.yml.pkgr > config/database.yml
# configure memcache
sed -i -e "s/.*config.cache_store.*file_store.*cache_file_store.*/ config.cache_store = :dalli_store, '${MEMCACHED_HOST}:${MEMCACHED_PORT}'\\n config.session_store = :dalli_store, '${MEMCACHED_HOST}:${MEMCACHED_PORT}'/" config/application.rb
# configure trusted proxies # configure trusted proxies
sed -i -e "s#config.action_dispatch.trusted_proxies =.*#config.action_dispatch.trusted_proxies = ${RAILS_TRUSTED_PROXIES}#" config/environments/production.rb sed -i -e "s#config.action_dispatch.trusted_proxies =.*#config.action_dispatch.trusted_proxies = ${RAILS_TRUSTED_PROXIES}#" config/environments/production.rb
@ -78,6 +75,7 @@ if [ "$1" = 'zammad-init' ]; then
echo "${AUTOWIZARD_JSON}" | base64 -d > auto_wizard.json echo "${AUTOWIZARD_JSON}" | base64 -d > auto_wizard.json
fi fi
else else
bundle exec rails r "Cache.clear"
bundle exec rake db:migrate bundle exec rake db:migrate
fi fi

View File

@ -3,7 +3,7 @@ set -e
# install dependencies # install dependencies
if [ "$1" = 'builder' ]; then if [ "$1" = 'builder' ]; then
PACKAGES="build-essential curl git libimlib2-dev libpq-dev shared-mime-info" PACKAGES="build-essential curl git libimlib2-dev libpq-dev nodejs shared-mime-info"
elif [ "$1" = 'runner' ]; then elif [ "$1" = 'runner' ]; then
PACKAGES="curl libimlib2 libpq5 nginx rsync" PACKAGES="curl libimlib2 libpq5 nginx rsync"
fi fi

View File

@ -1,4 +1,4 @@
version: '2' version: '3'
services: services:
@ -6,6 +6,7 @@ services:
command: ["zammad-backup"] command: ["zammad-backup"]
depends_on: depends_on:
- zammad-railsserver - zammad-railsserver
- zammad-postgresql
entrypoint: /usr/local/bin/backup.sh entrypoint: /usr/local/bin/backup.sh
environment: environment:
- BACKUP_SLEEP=86400 - BACKUP_SLEEP=86400
@ -13,8 +14,6 @@ services:
- POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_USER=${POSTGRES_USER}
- POSTGRESQL_PASSWORD=${POSTGRES_PASS} - POSTGRESQL_PASSWORD=${POSTGRES_PASS}
image: ${IMAGE_REPO}:zammad-postgresql${VERSION} image: ${IMAGE_REPO}:zammad-postgresql${VERSION}
links:
- zammad-postgresql
restart: ${RESTART} restart: ${RESTART}
volumes: volumes:
- zammad-backup:/var/tmp/zammad - zammad-backup:/var/tmp/zammad
@ -36,16 +35,13 @@ services:
- POSTGRESQL_USER=${POSTGRES_USER} - POSTGRESQL_USER=${POSTGRES_USER}
- POSTGRESQL_PASS=${POSTGRES_PASS} - POSTGRESQL_PASS=${POSTGRES_PASS}
image: ${IMAGE_REPO}:zammad${VERSION} image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-elasticsearch
- zammad-postgresql
restart: on-failure restart: on-failure
volumes: volumes:
- zammad-data:/opt/zammad - zammad-data:/opt/zammad
zammad-memcached: zammad-memcached:
command: memcached -m 256M command: memcached -m 256M
image: memcached:1.6.9-alpine image: memcached:1.6.10-alpine
restart: ${RESTART} restart: ${RESTART}
zammad-nginx: zammad-nginx:
@ -55,9 +51,6 @@ services:
depends_on: depends_on:
- zammad-railsserver - zammad-railsserver
image: ${IMAGE_REPO}:zammad${VERSION} image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-railsserver
- zammad-websocket
restart: ${RESTART} restart: ${RESTART}
volumes: volumes:
- zammad-data:/opt/zammad - zammad-data:/opt/zammad
@ -76,25 +69,23 @@ services:
depends_on: depends_on:
- zammad-memcached - zammad-memcached
- zammad-postgresql - zammad-postgresql
- zammad-redis
image: ${IMAGE_REPO}:zammad${VERSION} image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-elasticsearch
- zammad-memcached
- zammad-postgresql
restart: ${RESTART} restart: ${RESTART}
volumes: volumes:
- zammad-data:/opt/zammad - zammad-data:/opt/zammad
zammad-redis:
image: redis:6.2.5-alpine
restart: ${RESTART}
zammad-scheduler: zammad-scheduler:
command: ["zammad-scheduler"] command: ["zammad-scheduler"]
depends_on: depends_on:
- zammad-memcached - zammad-memcached
- zammad-railsserver - zammad-railsserver
- zammad-redis
image: ${IMAGE_REPO}:zammad${VERSION} image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-elasticsearch
- zammad-memcached
- zammad-postgresql
restart: ${RESTART} restart: ${RESTART}
volumes: volumes:
- zammad-data:/opt/zammad - zammad-data:/opt/zammad
@ -104,10 +95,8 @@ services:
depends_on: depends_on:
- zammad-memcached - zammad-memcached
- zammad-railsserver - zammad-railsserver
- zammad-redis
image: ${IMAGE_REPO}:zammad${VERSION} image: ${IMAGE_REPO}:zammad${VERSION}
links:
- zammad-postgresql
- zammad-memcached
restart: ${RESTART} restart: ${RESTART}
volumes: volumes:
- zammad-data:/opt/zammad - zammad-data:/opt/zammad