FROM debian:8
|
MAINTAINER Jacek Kowalski <Jacek@jacekk.info>
|
|
ENV HTTP_HOST=casebox.local \
|
HTTP_WEBMASTER=casebox@casebox.local \
|
MAIL_ADMIN=casebox@casebox.local \
|
MAIL_SENDER=casebox@casebox.local \
|
MYSQL_HOST=mysql \
|
MYSQL_PORT=3306 \
|
MYSQL_USER=casebox \
|
MYSQL_PASS=casebox123 \
|
APACHE_VHOST_CONFIG=/etc/apache2/sites-enabled/casebox.conf \
|
APACHE_USER=www-data \
|
APACHE_GROUP=www-data \
|
CASEBOX_URL=http://casebox.local/ \
|
CASEBOX_PREFIX=/var/www \
|
CASEBOX_CORE=casebox \
|
CASEBOX_PASS=casebox123 \
|
SOLR_PREFIX=/srv \
|
SOLR_VERSION=6.0.0
|
|
# Debian APT configuration
|
RUN echo 'deb http://httpredir.debian.org/debian jessie main' > /etc/apt/sources.list \
|
&& echo 'deb http://httpredir.debian.org/debian jessie-updates main' >> /etc/apt/sources.list \
|
&& echo 'deb http://httpredir.debian.org/debian jessie-backports main' >> /etc/apt/sources.list \
|
&& echo 'deb http://security.debian.org jessie/updates main' >> /etc/apt/sources.list
|
|
# Dependencies (packages)
|
RUN apt-get -y update \
|
&& apt-get -y dist-upgrade \
|
&& apt-get -y -t jessie-backports install openjdk-8-jre-headless \
|
&& apt-get -y --no-install-recommends install curl cron gettext-base \
|
git libapache2-mod-php5 libreoffice-common mariadb-client \
|
php5-curl php5-imagick php5-mysqlnd php5-readline \
|
sudo unoconv unzip \
|
&& apt-get -y clean
|
|
# Dependencies (Solr)
|
WORKDIR ${SOLR_PREFIX}
|
RUN curl -k -O https://www.eu.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz \
|
&& tar xf solr-${SOLR_VERSION}.tgz \
|
&& ln -s solr-${SOLR_VERSION} solr \
|
&& rm solr-${SOLR_VERSION}.tgz \
|
&& useradd -r -m -U solr \
|
&& chown -Rf solr:solr solr-${SOLR_VERSION}
|
RUN mkdir -p solr-data \
|
&& mv solr/server/solr solr/server/solr.bak \
|
&& ln -s ${SOLR_PREFIX}/solr-data solr/server/solr
|
VOLUME ${SOLR_PREFIX}/solr-data
|
|
# Apache configuration
|
RUN a2enmod rewrite headers \
|
&& rm -f /etc/apache2/sites-enabled/*
|
|
# Casebox installation
|
WORKDIR ${CASEBOX_PREFIX}
|
RUN git clone --depth=1 https://github.com/KETSE/casebox.git \
|
&& mkdir -p casebox/data casebox/logs casebox/docker
|
VOLUME ${CASEBOX_PREFIX}/casebox/data
|
VOLUME ${CASEBOX_PREFIX}/casebox/logs
|
|
# Configuration templates
|
COPY apache.conf casebox.ini ${CASEBOX_PREFIX}/casebox/docker/
|
|
# Start script
|
COPY start.sh /
|
CMD /start.sh
|