log to stdout

This commit is contained in:
André Bauer 2018-04-14 16:23:15 +02:00
parent 03a4c5d848
commit 2a7f97136f
2 changed files with 9 additions and 4 deletions

View File

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

View File

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