Commit f621f3fc203a197b867e493fd3a29e0bbd279368

Authored by Matthijs Brouwer
1 parent ffb31b7a

initial dockerfile

docker/Dockerfile 0 → 100644
  1 +# Automatically generated Dockerfile
  2 +# - Build 2016-11-07 18:42
  3 +# - Lucene/Solr version 6.2.0
  4 +# - Mtas release 20161027
  5 +#
  6 +# To run this image after installing Docker, use the following command:
  7 +#
  8 +
  9 +FROM ubuntu:16.04
  10 +MAINTAINER Matthijs Brouwer
  11 +
  12 +LABEL mtas.timestamp="2016-11-07 18:42"
  13 +LABEL mtas.lucene="6.2.0"
  14 +LABEL mtas.release="20161027"
  15 +
  16 +EXPOSE 8983 80
  17 +
  18 +USER root
  19 +
  20 +WORKDIR "/root"
  21 +
  22 +RUN mkdir lib && mkdir data && mkdir data/mtas && mkdir folia-samples && mkdir site && mkdir site/js && mkdir site/css
  23 +
  24 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/solrconfig.xml /root/data/
  25 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/mtas.xml /root/data/
  26 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/mtas/demo_folia.xml /root/data/mtas/
  27 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/mtas/demo_tei.xml /root/data/mtas/
  28 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/schemaBasic.xml /root/data/
  29 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/schemaFull.xml /root/data/
  30 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/folia-samples/beets1.xml.gz /root/folia-samples/
  31 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/folia-samples/beets2.xml.gz /root/folia-samples/
  32 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/folia-samples/beets3.xml.gz /root/folia-samples/
  33 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/index.html /root/site/
  34 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/example_demo1.html /root/site/
  35 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/example_demo2.html /root/site/
  36 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/css/style.css /root/site/css/
  37 +ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/js/solr.js /root/site/js/
  38 +
  39 +ADD http://apache.cs.uu.nl/commons/math/binaries/commons-math3-3.6.1-bin.tar.gz /root/lib/
  40 +ADD https://github.com/meertensinstituut/mtas/releases/download/20161027/mtas-6.2.0.jar /root/lib/
  41 +ADD http://code.jquery.com/jquery-3.1.1.min.js /root/site/js/
  42 +
  43 +RUN tar xzf lib/commons-math3-3.6.1-bin.tar.gz -C lib commons-math3-3.6.1/commons-math3-3.6.1.jar --strip-components=1 && rm lib/commons-math3-3.6.1-bin.tar.gz
  44 +
  45 +RUN apt-get update && apt-get install -y \
  46 +lsof \
  47 +software-properties-common \
  48 +python-software-properties \
  49 +apache2 \
  50 +curl
  51 +
  52 +RUN solrurl=$(curl -s 'http://www.apache.org/dyn/closer.lua/lucene/solr/6.2.0/solr-6.2.0.tgz' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g' | head -1) \
  53 +&& curl -o /root/solr-6.2.0.tgz -O $solrurl
  54 +
  55 +RUN mathurl=$(curl -s 'http://www.apache.org/dyn/closer.lua/commons/math/binaries/commons-math3-3.6.1-bin.tar.gz' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g' | head -1) \
  56 +&& curl -o /root/lib/commons-math3-3.6.1-bin.tar.gz -O $mathurl
  57 +
  58 +RUN add-apt-repository -y ppa:webupd8team/java \
  59 +&& apt-get update \
  60 +&& echo oracle-java8-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections \
  61 +&& apt-get install -y oracle-java8-installer
  62 +
  63 +RUN rm -rf /var/lib/apt/lists/*
  64 +
  65 +RUN tar xzf solr-6.2.0.tgz solr-6.2.0/bin/install_solr_service.sh --strip-components=2 \
  66 +&& bash ./install_solr_service.sh solr-6.2.0.tgz && rm install_solr_service.sh && rm -rf solr-6.2.0.tgz
  67 +
  68 +RUN service apache2 stop \
  69 +&& a2enmod proxy \
  70 +&& a2enmod proxy_http \
  71 +&& a2enmod proxy_ajp \
  72 +&& a2enmod rewrite \
  73 +&& a2enmod deflate \
  74 +&& a2enmod headers \
  75 +&& a2enmod proxy_balancer \
  76 +&& a2enmod proxy_connect \
  77 +&& a2enmod proxy_html \
  78 +&& sed -i '/<\/VirtualHost>/ i ProxyPass /solr http://localhost:8983/solr\nProxyPassReverse /solr http://localhost:8983/solr' /etc/apache2/sites-enabled/000-default.conf
  79 +
  80 +RUN rm /var/www/html/index.html \
  81 +&& mkdir /var/www/html/demo \
  82 +&& cp -rp folia-samples /var/www/html/demo/ \
  83 +&& gunzip -r /var/www/html/demo \
  84 +&& cp -rp site/* /var/www/html/ \
  85 +&& chmod -R 755 /var/www/html
  86 +
  87 +RUN printf "service solr start\nservice apache2 start\n" > /start.sh && chmod 755 /start.sh
  88 +
  89 +RUN mkdir demo1 && mkdir demo1/lib && mkdir demo1/conf && echo "name=demo1" > demo1/core.properties \
  90 +&& cp lib/commons-math3-3.6.1.jar demo1/lib/ && cp lib/mtas-6.2.0.jar demo1/lib/ \
  91 +&& cp data/solrconfig.xml demo1/conf/ && cp data/schemaBasic.xml demo1/conf/schema.xml \
  92 +&& cp -r data/mtas demo1/conf/ && cp data/mtas.xml demo1/conf/ \
  93 +&& chmod -R 777 demo1 && cp -rp demo1 demo2 \
  94 +&& cp data/schemaFull.xml demo2/conf/schema.xml && echo "name=demo2" > demo2/core.properties\
  95 +&& mv demo1 /var/solr/data/ && mv demo2 /var/solr/data/
  96 +
  97 +CMD bash -C '/start.sh'; 'bash'
  98 +
  99 +
  100 +
  101 +
  102 +
... ...
src/docker/Dockerfile
... ... @@ -17,7 +17,7 @@ EXPOSE 8983 80
17 17  
18 18 USER root
19 19  
20   -WORKDIR "/root"
  20 +WORKDIR "/root"
21 21  
22 22 RUN mkdir lib && mkdir data && mkdir data/mtas && mkdir folia-samples && mkdir site && mkdir site/js && mkdir site/css
23 23  
... ... @@ -36,7 +36,6 @@ ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/
36 36 ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/css/style.css /root/site/css/
37 37 ADD https://raw.githubusercontent.com/meertensinstituut/mtas/master/docker/site/js/solr.js /root/site/js/
38 38  
39   -ADD http://archive.apache.org/dist/lucene/solr/${currentDevelopmentVersion}/solr-${currentDevelopmentVersion}.tgz /root/
40 39 ADD http://apache.cs.uu.nl/commons/math/binaries/commons-math3-3.6.1-bin.tar.gz /root/lib/
41 40 ADD https://github.com/meertensinstituut/mtas/releases/download/${currentDevelopmentRelease}/mtas-${currentDevelopmentVersion}.jar /root/lib/
42 41 ADD http://code.jquery.com/jquery-3.1.1.min.js /root/site/js/
... ... @@ -47,7 +46,14 @@ RUN apt-get update &amp;&amp; apt-get install -y \
47 46 lsof \
48 47 software-properties-common \
49 48 python-software-properties \
50   -apache2
  49 +apache2 \
  50 +curl
  51 +
  52 +RUN solrurl=$(curl -s 'http://www.apache.org/dyn/closer.lua/lucene/solr/${currentDevelopmentVersion}/solr-${currentDevelopmentVersion}.tgz' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g' | head -1) \
  53 +&& curl -o /root/solr-${currentDevelopmentVersion}.tgz -O $solrurl
  54 +
  55 +RUN mathurl=$(curl -s 'http://www.apache.org/dyn/closer.lua/commons/math/binaries/commons-math3-3.6.1-bin.tar.gz' | grep -o '<strong>[^<]*</strong>' | sed 's/<[^>]*>//g' | head -1) \
  56 +&& curl -o /root/lib/commons-math3-3.6.1-bin.tar.gz -O $mathurl
51 57  
52 58 RUN add-apt-repository -y ppa:webupd8team/java \
53 59 && apt-get update \
... ...