This repository has been archived by the owner on May 2, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
66 lines (62 loc) · 2.37 KB
/
Dockerfile
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
# Docker container for lmh
# (c) The KWARC Group 2015
FROM debian:stable
MAINTAINER Mihnea Iancu <[email protected]>
# make apt-get faster, from https://gist.github.com/jpetazzo/6127116
# this forces dpkg not to call sync() after package extraction and speeds up install
RUN echo "force-unsafe-io" > /etc/dpkg/dpkg.cfg.d/02apt-speedup
# we don't need and apt cache in a container
RUN echo "Acquire::http {No-Cache=True;};" > /etc/apt/apt.conf.d/no-cache
#
# Install all the packages
# This might take a while
#
RUN apt-get update && \
apt-get dist-upgrade -y && \
apt-get install -y python python-dev python-pip git subversion wget tar fontconfig perl cpanminus libxml2-dev libxslt-dev libgdbm-dev openjdk-7-jre-headless && \
apt-get clean
#
# Install lmh itself
# + disable pdflatex support (to avoid texlive)
#
RUN git clone https://github.com/KWARC/localmh $HOME/localmh; \
pip install beautifulsoup4 psutil pyapi-gitlab; \
ln -s $HOME/localmh/bin/lmh /usr/local/bin/lmh; \
lmh config env::pdflatex /bin/false; \
lmh setup --no-firstrun --install all
#
# Installing MathHub Deps
#
### Installing LAMP
RUN apt-get install -y mysql-server apache2 php5 php5-mysql libapache2-mod-php5 php5-gd && apt-get clean
# Cloning Drupal Code
RUN git clone https://github.com/KWARC/MathHub /var/www/mathhub.info
# Configuring Apache
ADD mathhub.info /etc/apache2/sites-available/
ADD settings.php /var/www/mathhub.info/sites/default/
RUN chmod 777 /var/www/mathhub.info/sites/default/files
RUN a2enmod rewrite && a2dissite default && a2ensite mathhub.info
# Configuring MySQL
RUN service mysql start; mysql -u root -e "create database mathhub;"
# Adding run script
ADD start-mh /usr/local/bin/
#
# Setting up basic mathhub stuff (can be overridden locally by mounting folders)
#
#Installing smglom
RUN mkdir ~/.ssh/ && ssh-keyscan gl.mathhub.info > ~/.ssh/known_hosts
RUN lmh config install::sources "http://gl.mathhub.info/"
RUN lmh config install::nomanifest true
RUN lmh install smglom/mv -y; true
RUN lmh install meta/inf -y; true
RUN lmh install smglom/meta-inf -y; true
RUN cd $(lmh root)/MathHub/ && lmh gen --localpaths
RUN cd $(lmh root)/MathHub/ && lmh gen --omdoc
#RUN #(lmh root)/ext/MMT/mmt $(lmh root)/MathHub/build.msl
#Adding dictionary info
ADD dict_data.json ~/localmh/MathHub/
ADD term_links.json ~/localmh/MathHub/
#
# And run the tails command, to do nothing
#
CMD /bin/bash -c "tail -f /dev/null"