Jacek Kowalski
2016-05-02 0cf5a669f2644ccc3d50b58a2e93ebb03caaee40
commit | author | age
0cf5a6 1 FROM debian:8
JK 2 MAINTAINER Jacek Kowalski <Jacek@jacekk.info>
3
4 ENV    HTTP_HOST=casebox.local \
5     HTTP_WEBMASTER=casebox@casebox.local \
6     MAIL_ADMIN=casebox@casebox.local \
7     MAIL_SENDER=casebox@casebox.local \
8     MYSQL_HOST=mysql \
9     MYSQL_PORT=3306 \
10     MYSQL_USER=casebox \
11     MYSQL_PASS=casebox123 \
12     APACHE_VHOST_CONFIG=/etc/apache2/sites-enabled/casebox.conf \
13     APACHE_USER=www-data \
14     APACHE_GROUP=www-data \
15     CASEBOX_URL=http://casebox.local/ \
16     CASEBOX_PREFIX=/var/www \
17     CASEBOX_CORE=casebox \
18     CASEBOX_PASS=casebox123 \
19     SOLR_PREFIX=/srv \
20     SOLR_VERSION=6.0.0
21
22 # Debian APT configuration
23 RUN echo 'deb http://httpredir.debian.org/debian jessie main' > /etc/apt/sources.list \
24     && echo 'deb http://httpredir.debian.org/debian jessie-updates main' >> /etc/apt/sources.list \
25     && echo 'deb http://httpredir.debian.org/debian jessie-backports main' >> /etc/apt/sources.list \
26     && echo 'deb http://security.debian.org jessie/updates main' >> /etc/apt/sources.list
27
28 # Dependencies (packages)
29 RUN apt-get -y update \
30     && apt-get -y dist-upgrade \
31     && apt-get -y -t jessie-backports install openjdk-8-jre-headless \
32     && apt-get -y --no-install-recommends install curl cron gettext-base \
33         git libapache2-mod-php5 libreoffice-common mariadb-client \
34         php5-curl php5-imagick php5-mysqlnd php5-readline \
35         sudo unoconv unzip \
36     && apt-get -y clean
37
38 # Dependencies (Solr)
39 WORKDIR ${SOLR_PREFIX}
40 RUN curl -k -O https://www.eu.apache.org/dist/lucene/solr/${SOLR_VERSION}/solr-${SOLR_VERSION}.tgz \
41     && tar xf solr-${SOLR_VERSION}.tgz \
42     && ln -s solr-${SOLR_VERSION} solr \
43     && rm solr-${SOLR_VERSION}.tgz \
44     && useradd -r -m -U solr \
45     && chown -Rf solr:solr solr-${SOLR_VERSION}
46 RUN mkdir -p solr-data \
47     && mv solr/server/solr solr/server/solr.bak \
48     && ln -s ${SOLR_PREFIX}/solr-data solr/server/solr
49 VOLUME ${SOLR_PREFIX}/solr-data
50
51 # Apache configuration
52 RUN a2enmod rewrite headers \
53     && rm -f /etc/apache2/sites-enabled/*
54
55 # Casebox installation
56 WORKDIR ${CASEBOX_PREFIX}
57 RUN git clone --depth=1 https://github.com/KETSE/casebox.git \
58     && mkdir -p casebox/data casebox/logs casebox/docker
59 VOLUME ${CASEBOX_PREFIX}/casebox/data
60 VOLUME ${CASEBOX_PREFIX}/casebox/logs
61
62 # Configuration templates
63 COPY apache.conf casebox.ini ${CASEBOX_PREFIX}/casebox/docker/
64
65 # Start script
66 COPY start.sh /
67 CMD /start.sh