-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathDockerfile
More file actions
70 lines (54 loc) · 1.85 KB
/
Dockerfile
File metadata and controls
70 lines (54 loc) · 1.85 KB
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
68
69
70
FROM ubuntu:14.04
MAINTAINER Michael Bartoli <michael.bartoli@pomona.edu>
RUN apt-get update
RUN apt-get -y install \
python \
build-essential \
python-dev \
python-pip \
git \
vowpal-wabbit \
apache2 \
libapache2-mod-wsgi \
apache2-utils
RUN pip install nltk
WORKDIR /home
RUN git clone https://github.com/mbartoli/docent-learner
WORKDIR /home/docent-learner
# create admin account
ENV adminpass='admin'
ENV adminuname='admin'
RUN htpasswd -cb /etc/apache2/docent-learner-admin-pwfile ${adminuname} ${adminpass}
RUN echo "$adminuname $adminpass" && echo "$adminuname $adminpass" >> /home/admin-password.txt
# server setup
ENV basedir="/var/www/html/docent-learner"
ENV imagesdir="images"
ENV tweetsdir="tweets"
ENV textselectdir="textselect"
ENV pydir="/var/www/docent-learner/"
RUN mkdir -p ${basedir}
RUN mkdir "${basedir}/boldtext"
RUN chmod a+rw "${basedir}/boldtext"
RUN mkdir -p "${basedir}/${imagesdir}"
RUN cp images/* "${basedir}/${imagesdir}"
RUN chmod a+rw "${basedir}/${imagesdir}"
RUN mkdir -p "${basedir}/${tweetsdir}"
RUN cp tweets/* "${basedir}/${tweetsdir}"
RUN chmod a+rw "${basedir}/${tweetsdir}"
RUN mkdir -p "${basedir}/${textselectdir}"
RUN cp textselect/* "${basedir}/${textselectdir}"
RUN chmod a+rw "${basedir}/${textselectdir}"
# Copy python source
RUN mkdir -p "${pydir}"
RUN cp -r src/* "${pydir}"
RUN mkdir -p "${basedir}/var/"
RUN cp -r var/* "${basedir}/var/"
RUN chmod a+rw "/var/www/html/docent-learner/var/config/config.json"
RUN chmod a+rw "/var/www/html/docent-learner/var/textselect-modelbuild.lock"
RUN chmod a+rw "/var/www/html/docent-learner/var/textselect-model-build-status.txt"
RUN mkdir -p "${basedir}/static/"
RUN cp -r static/* "${basedir}/static/"
RUN cp -r html/* "${basedir}"
RUN echo 'ServerName localhost' >> /etc/apache2/conf.d
RUN cp sites-enabled/docent-learner-apache.conf /etc/apache2/sites-enabled/
EXPOSE 80