From 1e1f5141065dd99cd4df758cc5888f4ab3b100c8 Mon Sep 17 00:00:00 2001 From: Sameer Naik Date: Sun, 12 Jul 2015 16:27:42 +0530 Subject: [PATCH] dockerfile: added `RAILS_ENV` environment variable --- Dockerfile | 3 ++- assets/setup/install.sh | 4 ++-- entrypoint.sh | 16 ++++++++-------- 3 files changed, 12 insertions(+), 11 deletions(-) diff --git a/Dockerfile b/Dockerfile index 1f8d337d..326cf563 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,8 @@ ENV GITLAB_VERSION=7.12.2 \ GITLAB_USER="git" \ GITLAB_HOME="/home/git" \ GITLAB_LOG_DIR="/var/log/gitlab" \ - SETUP_DIR="/var/cache/gitlab" + SETUP_DIR="/var/cache/gitlab" \ + RAILS_ENV=production ENV GITLAB_INSTALL_DIR="${GITLAB_HOME}/gitlab" \ GITLAB_SHELL_INSTALL_DIR="${GITLAB_HOME}/gitlab-shell" \ diff --git a/assets/setup/install.sh b/assets/setup/install.sh index 8c4dd6a9..5825c143 100755 --- a/assets/setup/install.sh +++ b/assets/setup/install.sh @@ -180,7 +180,7 @@ cat > /etc/supervisor/conf.d/unicorn.conf </dev/null + sudo -HEu ${GITLAB_USER} force=yes bundle exec rake gitlab:setup ${GITLAB_ROOT_PASSWORD:+GITLAB_ROOT_PASSWORD=$GITLAB_ROOT_PASSWORD} >/dev/null fi # migrate database and compile the assets if the gitlab version or relative_url has changed. @@ -723,7 +723,7 @@ appInit () { [[ -f tmp/cache/GITLAB_RELATIVE_URL_ROOT ]] && CACHE_GITLAB_RELATIVE_URL_ROOT=$(cat tmp/cache/GITLAB_RELATIVE_URL_ROOT) if [[ ${GITLAB_VERSION} != ${CACHE_VERSION} || ${GITLAB_RELATIVE_URL_ROOT} != ${CACHE_GITLAB_RELATIVE_URL_ROOT} ]]; then echo "Migrating database..." - sudo -HEu ${GITLAB_USER} bundle exec rake db:migrate RAILS_ENV=production >/dev/null + sudo -HEu ${GITLAB_USER} bundle exec rake db:migrate >/dev/null # recreate the tmp directory rm -rf ${GITLAB_DATA_DIR}/tmp @@ -735,8 +735,8 @@ appInit () { sudo -HEu ${GITLAB_USER} mkdir -p ${GITLAB_DATA_DIR}/tmp/public/assets/ echo "Compiling assets. Please be patient, this could take a while..." - sudo -HEu ${GITLAB_USER} bundle exec rake assets:clean RAILS_ENV=production >/dev/null 2>&1 - sudo -HEu ${GITLAB_USER} bundle exec rake assets:precompile RAILS_ENV=production >/dev/null 2>&1 + sudo -HEu ${GITLAB_USER} bundle exec rake assets:clean >/dev/null 2>&1 + sudo -HEu ${GITLAB_USER} bundle exec rake assets:precompile >/dev/null 2>&1 sudo -HEu ${GITLAB_USER} touch tmp/cache/VERSION sudo -HEu ${GITLAB_USER} echo "${GITLAB_VERSION}" > tmp/cache/VERSION sudo -HEu ${GITLAB_USER} echo "${GITLAB_RELATIVE_URL_ROOT}" > tmp/cache/GITLAB_RELATIVE_URL_ROOT @@ -757,19 +757,19 @@ appInit () { daily) sudo -HEu ${GITLAB_USER} cat > /tmp/cron.${GITLAB_USER} < /tmp/cron.${GITLAB_USER} < /tmp/cron.${GITLAB_USER} <