From 2a7f97136fc485a2e15750bab440b012df069603 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Sat, 14 Apr 2018 16:23:15 +0200 Subject: [PATCH] log to stdout --- containers/zammad/Dockerfile | 4 +++- containers/zammad/docker-entrypoint.sh | 9 ++++++--- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/containers/zammad/Dockerfile b/containers/zammad/Dockerfile index e2bbe63..b11ec6d 100644 --- a/containers/zammad/Dockerfile +++ b/containers/zammad/Dockerfile @@ -34,7 +34,7 @@ RUN BUILD_DEPENDENCIES="build-essential ca-certificates curl git libffi-dev libp && export GNUPGHOME="$(mktemp -d)" \ && gpg --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 \ && gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu \ - && rm -rf "${GNUPGHOME}" /usr/local/bin/gosu.asc \ + && rm -rf "${GNUPGHOME}" /usr/locaproductions.logl/bin/gosu.asc \ && chmod +x /usr/local/bin/gosu \ && gosu nobody true @@ -49,6 +49,8 @@ RUN groupadd -g 1000 ${ZAMMAD_USER} \ && bundle install --without test development mysql \ && contrib/packager.io/fetch_locales.rb \ && sed -e 's#.*adapter: postgresql# adapter: nulldb#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: zammad-postgresql\n#g' < config/database.yml.pkgr > config/database.yml \ + && sed -i '/# Use a different logger for distributed setups./a \ \ config.logger = Logger.new(STDOUT)' config/environments/production.rb \ + && sed -i 's/.*scheduler_\(err\|out\).log.*//g' script/scheduler.rb \ && bundle exec rake assets:precompile \ && rm -r tmp/cache \ && chown -R ${ZAMMAD_USER}:${ZAMMAD_USER} ${ZAMMAD_TMP_DIR} diff --git a/containers/zammad/docker-entrypoint.sh b/containers/zammad/docker-entrypoint.sh index 5cf6edb..619546e 100644 --- a/containers/zammad/docker-entrypoint.sh +++ b/containers/zammad/docker-entrypoint.sh @@ -5,6 +5,7 @@ set -e : "${ELASTICSEARCH_HOST:=zammad-elasticsearch}" : "${ELASTICSEARCH_PORT:=9200}" : "${MEMCACHED_HOST:=zammad-memcached}" +: "${MEMCACHED_PORT:=11211}" : "${POSTGRESQL_HOST:=zammad-postgresql}" : "${POSTGRESQL_USER:=postgres}" : "${POSTGRESQL_PASS:=}" @@ -26,7 +27,7 @@ function check_zammad_ready { if [ "$1" = 'zammad-init' ]; then # install / update zammad test -f ${ZAMMAD_READY_FILE} && rm ${ZAMMAD_READY_FILE} - rsync -a --delete --exclude 'storage/fs/*' --exclude 'public/assets/images/*' ${ZAMMAD_TMP_DIR}/ ${ZAMMAD_DIR} + rsync -a --delete --exclude --exclude 'public/assets/images/*' --exclude 'storage/fs/*' ${ZAMMAD_TMP_DIR}/ ${ZAMMAD_DIR} rsync -a ${ZAMMAD_TMP_DIR}/public/assets/images/ ${ZAMMAD_DIR}/public/assets/images until (echo > /dev/tcp/${POSTGRESQL_HOST}/5432) &> /dev/null; do @@ -36,9 +37,11 @@ if [ "$1" = 'zammad-init' ]; then cd ${ZAMMAD_DIR} - # configure database & cache + # configure database 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: ${POSTGRESQL_PASS}\n host: ${POSTGRESQL_HOST}\n#g" < config/database.yml.pkgr > config/database.yml - sed -i -e "s/.*config.cache_store.*file_store.*cache_file_store.*/ config.cache_store = :dalli_store, '${MEMCACHED_HOST}:11211'\n config.session_store = :dalli_store, '${MEMCACHED_HOST}:11211'/" config/application.rb + + # 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 echo "initialising / updating database..." # db mirgrate