Jacek Kowalski
2016-05-02 0cf5a669f2644ccc3d50b58a2e93ebb03caaee40
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
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