moved asstes precompile into image & bash variables into dockerfile env

This commit is contained in:
André Bauer 2017-01-07 13:52:50 +01:00
parent 53abeda69b
commit d4eefe47f4
4 changed files with 17 additions and 16 deletions

View File

@ -2,6 +2,15 @@ FROM ruby:2.3.1
MAINTAINER André Bauer <monotek23@gmail.com>
ARG BUILD_DATE
ENV ZAMMAD_DIR /home/zammad
ENV ZAMMAD_DEBUG no
ENV RAILS_ENV production
ENV RAILS_SERVER puma
ENV GIT_URL https://github.com/zammad/zammad.git
ENV GIT_BRANCH develop
#ENV GIT_URL https://github.com/monotek/zammad.git
#ENV GIT_BRANCH nulldb
LABEL org.label-schema.build-date="$BUILD_DATE" \
org.label-schema.name="Zammad" \
org.label-schema.license="AGPL-3.0" \

View File

@ -32,3 +32,7 @@ This repo is meant to be the starting point for somebody who likes to use docker
### Building locally
* docker-compose -f docker-compose-build.yml up
### DockerHub Repo
* https://hub.docker.com/r/monotek/zammad-docker-compose/

View File

@ -1,14 +1,7 @@
#!/bin/bash
ZAMMAD_DIR="/home/zammad"
RAILS_SERVER="puma"
RAILS_ENV="production"
DEBUG="no"
if [ "$1" = 'zammad' ]; then
export RAILS_ENV=${RAILS_ENV}
cd ${ZAMMAD_DIR}
rake db:migrate &> /dev/null
@ -17,7 +10,6 @@ if [ "$1" = 'zammad' ]; then
rake db:create
rake db:migrate
rake db:seed
rake assets:precompile
rails r "Setting.set('es_url', 'http://elasticsearch:9200')"
rake searchindex:rebuild
fi
@ -38,7 +30,7 @@ if [ "$1" = 'zammad' ]; then
bundle exec unicorn -p 3000 -c config/unicorn.rb -E ${RAILS_ENV}
fi
if [ "${DEBUG}" == "yes" ]; then
if [ "${ZAMMAD_DEBUG}" == "yes" ]; then
# keepalive if error
while true; do
echo "debugging..."

View File

@ -1,11 +1,5 @@
#!/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"
# install zammad
echo "installing zammad..."
cd /tmp
@ -15,5 +9,7 @@ cp -R /tmp/zammad/.[!.]* ${ZAMMAD_DIR}
cd ${ZAMMAD_DIR}
rm -rf /tmp/zammad
bundle install --without test development mysql
sed -e 's#.*username:.*# username: postgres#g' -e 's#.*password:.*# password: \n host: postgresql\n#g' < config/database.yml.pkgr > config/database.yml
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
bundle exec rake assets:precompile
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
chown -R zammad:zammad /home/zammad/