From 1403d48b8c30854a62aa567cc06d1ec203731d64 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Tue, 10 Jan 2017 11:46:26 +0100 Subject: [PATCH] moved zammad user creation to install script, clone directly to /home without using /tmp --- Dockerfile.zammad | 3 --- install-zammad.sh | 25 ++++++++++++++++++++----- 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/Dockerfile.zammad b/Dockerfile.zammad index fcb55d7..9f51e16 100644 --- a/Dockerfile.zammad +++ b/Dockerfile.zammad @@ -23,9 +23,6 @@ LABEL org.label-schema.build-date="$BUILD_DATE" \ EXPOSE 3000 EXPOSE 6042 -# add zammad user -RUN useradd -m -d /home/zammad -s /bin/bash zammad;chown -R zammad:zammad /home/zammad - # install zammad COPY install-zammad.sh /tmp RUN chmod +x /tmp/install-zammad.sh;/bin/bash -l -c /tmp/install-zammad.sh diff --git a/install-zammad.sh b/install-zammad.sh index ed3c3cc..3d76c4f 100644 --- a/install-zammad.sh +++ b/install-zammad.sh @@ -2,18 +2,33 @@ set -e -# install zammad echo "installing zammad..." -cd /tmp + +# crreate zammad user +useradd -M -d /home/zammad -s /bin/bash zammad + +# # git clone zammad +cd /home git clone --depth 1 -b "${GIT_BRANCH}" "${GIT_URL}" -cp -R /tmp/zammad/* "${ZAMMAD_DIR}" -cp -R /tmp/zammad/.[!.]* "${ZAMMAD_DIR}" + +# install zammad cd "${ZAMMAD_DIR}" -rm -rf /tmp/zammad bundle install --without test development mysql + +# fetch locales contrib/packager.io/fetch_locales.rb + +# set nulldb database adapter for assets precompile sed -e 's#.*adapter: postgresql# adapter: nulldb#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml + +# assets precompile bundle exec rake assets:precompile + +# set postgresql database adapter sed -e 's#.*adapter: postgresql# adapter: postgresql#g' -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml + +# delete assets precompile cache rm -r tmp/cache + +# set user & group to zammad chown -R zammad:zammad "${ZAMMAD_DIR}"