diff --git a/containers/zammad/Dockerfile b/containers/zammad/Dockerfile index c24b219..5a5168c 100644 --- a/containers/zammad/Dockerfile +++ b/containers/zammad/Dockerfile @@ -26,34 +26,34 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ org.label-schema.docker.cmd="sysctl -w vm.max_map_count=262144;docker-compose up" # install dependencies & gosu -RUN BUILD_DEPENDENCIES="build-essential ca-certificates curl dirmngr git gnupg2 libffi-dev libpq5 libpq-dev nginx rsync" \ - set -ex \ - && apt-get update && apt-get install -y --no-install-recommends ${BUILD_DEPENDENCIES} && rm -rf /var/lib/apt/lists/* \ - && curl -s -J -L -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture)" \ - && curl -s -J -L -o /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc" \ - && 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 \ - && chmod +x /usr/local/bin/gosu \ - && gosu nobody true +RUN BUILD_DEPENDENCIES="build-essential ca-certificates curl dirmngr git gnupg2 libffi-dev libpq5 libpq-dev nginx rsync" && \ + set -ex && \ + apt-get update && apt-get install -y --no-install-recommends ${BUILD_DEPENDENCIES} && rm -rf /var/lib/apt/lists/* && \ + curl -s -J -L -o /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture)" && \ + curl -s -J -L -o /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/${GOSU_VERSION}/gosu-$(dpkg --print-architecture).asc" && \ + export GNUPGHOME="$(mktemp -d)" && \ + gpg --no-tty --keyserver ha.pool.sks-keyservers.net --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 && \ + gpg --no-tty --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu && \ + rm -rf "${GNUPGHOME}" /usr/local/bin/gosu.asc && \ + chmod +x /usr/local/bin/gosu && \ + gosu nobody true # install zammad -RUN groupadd -g 1000 ${ZAMMAD_USER} \ - && useradd -M -d ${ZAMMAD_DIR} -s /bin/bash -u 1000 -g 1000 ${ZAMMAD_USER} \ - && cd $(dirname ${ZAMMAD_TMP_DIR}) \ - && curl -s -J -L -O "${TAR_GZ_URL}" \ - && tar -xzf zammad-${GIT_BRANCH}.tar.gz \ - && rm zammad-${GIT_BRANCH}.tar.gz \ - && cd ${ZAMMAD_TMP_DIR} \ - && 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' < contrib/packager.io/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} +RUN groupadd -g 1000 ${ZAMMAD_USER} && \ + useradd -M -d ${ZAMMAD_DIR} -s /bin/bash -u 1000 -g 1000 ${ZAMMAD_USER} && \ + cd $(dirname ${ZAMMAD_TMP_DIR}) && \ + curl -s -J -L -O "${TAR_GZ_URL}" && \ + tar -xzf zammad-${GIT_BRANCH}.tar.gz && \ + rm zammad-${GIT_BRANCH}.tar.gz && \ + cd ${ZAMMAD_TMP_DIR} && \ + 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' < contrib/packager.io/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} # docker init COPY containers/zammad/docker-entrypoint.sh /