From 1ae2f7659bf9a99b231dc2e2ff09d1aa9a6da2af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andr=C3=A9=20Bauer?= Date: Mon, 19 Dec 2016 21:39:15 +0100 Subject: [PATCH] added config file --- .gitignore | 3 +++ docker-entrypoint.sh | 20 +++++++++----------- entrypoint.config.dist | 9 +++++++++ 3 files changed, 21 insertions(+), 11 deletions(-) create mode 100644 .gitignore create mode 100644 entrypoint.config.dist diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..9b226ca --- /dev/null +++ b/.gitignore @@ -0,0 +1,3 @@ +# gitignore + +entrypoint.config \ No newline at end of file diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index b064a69..a720e16 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -1,17 +1,15 @@ #!/bin/bash -ZAMMAD_DIR="/home/zammad" -GIT_URL="https://github.com/zammad/zammad.git" -GIT_BRANCH="develop" -#GIT_URL="https://github.com/monotek/zammad.git" -#GIT_BRANCH="unicorn" -FRESH_INSTALL="no" -RAILS_SERVER="puma" -DEBUG="yes" +export RAILS_ENV="${RAILS_ENV}" -export RAILS_ENV="production" +shopt -s dotglob - shopt -s dotglob +if [ ! -f entrypoint.config ]; then + echo "entrypoint.config not found! create it from entrypoint.config.dist before running this script!" + exit 1 +fi + +. entrypoint.config if [ "${FRESH_INSTALL}" == "yes" ]; then echo "fresh install requested. delting everything in ${ZAMMAD_DIR}" @@ -53,8 +51,8 @@ if [ "$1" = 'zammad' ]; then echo "zammad will be accessable on http://localhost in some seconds" bundle exec script/websocket-server.rb -b 0.0.0.0 start & bundle exec script/scheduler.rb start & + if [ "${RAILS_SERVER}" == "puma" ]; then - #rails s -p 3000 -b 0.0.0.0 bundle exec puma -p 3000 -b 0.0.0.0 elif [ "${RAILS_SERVER}" == "unicorn" ]; then bundle exec unicorn -p 3000 -c config/unicorn.rb diff --git a/entrypoint.config.dist b/entrypoint.config.dist new file mode 100644 index 0000000..8b7b6c0 --- /dev/null +++ b/entrypoint.config.dist @@ -0,0 +1,9 @@ +#!/bin/bash + +ZAMMAD_DIR="/home/zammad" +GIT_URL="https://github.com/zammad/zammad.git" +GIT_BRANCH="develop" +FRESH_INSTALL="no" +RAILS_SERVER="puma" +DEBUG="no" +RAILS_ENV="production"