-
Notifications
You must be signed in to change notification settings - Fork 60
/
Dockerfile
60 lines (41 loc) · 1.71 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
# start from a base ubuntu image
FROM ubuntu
MAINTAINER Cass Johnston <[email protected]>
# set users cfg file
ARG USERS_CFG=users.json
# Install pre-reqs
RUN apt-get update
RUN apt-get install -y curl vim sudo wget rsync
RUN apt-get install -y apache2
RUN apt-get install -y python
RUN apt-get install -y supervisor
RUN apt-get clean
RUN rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
# Fetch brat
RUN mkdir /var/www/brat
RUN curl http://weaver.nlplab.org/~brat/releases/brat-v1.3_Crunchy_Frog.tar.gz > /var/www/brat/brat-v1.3_Crunchy_Frog.tar.gz
RUN cd /var/www/brat && tar -xvzf brat-v1.3_Crunchy_Frog.tar.gz
# create a symlink so users can mount their data volume at /bratdata rather than the full path
RUN mkdir /bratdata && mkdir /bratcfg
RUN chown -R www-data:www-data /bratdata /bratcfg
RUN chmod o-rwx /bratdata /bratcfg
RUN ln -s /bratdata /var/www/brat/brat-v1.3_Crunchy_Frog/data
RUN ln -s /bratcfg /var/www/brat/brat-v1.3_Crunchy_Frog/cfg
# And make that location a volume
VOLUME /bratdata
VOLUME /bratcfg
ADD brat_install_wrapper.sh /usr/bin/brat_install_wrapper.sh
RUN chmod +x /usr/bin/brat_install_wrapper.sh
# Make sure apache can access it
RUN chown -R www-data:www-data /var/www/brat/brat-v1.3_Crunchy_Frog/
ADD 000-default.conf /etc/apache2/sites-available/000-default.conf
# add the user patching script
ADD user_patch.py /var/www/brat/brat-v1.3_Crunchy_Frog/user_patch.py
# Enable cgi
RUN a2enmod cgi
EXPOSE 80
# We can't use apachectl as an entrypoint because it starts apache and then exits, taking your container with it.
# Instead, use supervisor to monitor the apache process
RUN mkdir -p /var/log/supervisor
ADD supervisord.conf /etc/supervisor/conf.d/supervisord.conf
CMD ["/usr/bin/supervisord"]