forked from ToolDAQ/WebServer
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile.server
More file actions
78 lines (71 loc) · 3.26 KB
/
Dockerfile.server
File metadata and controls
78 lines (71 loc) · 3.26 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
71
72
73
74
75
76
77
78
# server image
FROM tooldaq/web_base
RUN yum install -y \
httpd \
postgresql-server \
postgresql-devel \
libpq \
sudo \
procps-ng \
psmisc \
emacs \
libpcap-devel \
iputils \
iproute \
&& yum clean all \
&& rm -rf /var/cache/yum
RUN cd /opt \
&& wget https://github.com/ToolDAQ/libpqxx/raw/master/libpqxx-6.4.5_fixed.tar.gz \
&& tar zxvf libpqxx-6.4.5_fixed.tar.gz \
&& rm libpqxx-6.4.5_fixed.tar.gz \
&& cd libpqxx-6.4.5 \
&& mkdir install \
&& CXXFLAGS=-std=c++11 ./configure --disable-documentation --enable-shared --prefix=/opt/libpqxx-6.4.5/install \
&& make -j`nproc --all` \
&& make install
RUN cd /opt \
&& git clone https://github.com/ToolDAQ/middleman.git \
&& cd middleman/ \
&& git checkout v3.0 \
&& . ./Setup.sh \
&& make
# docs build fails if index.html is not present, which kills the docker build
RUN cd /opt \
&& git clone https://github.com/ToolDAQ/cgicc-3.2.9.git \
&& cd cgicc-3.2.9 \
&& ./configure \
&& mkdir -p doc/html \
&& touch doc/html/index.html \
&& make -j`nproc --all` \
&& make install \
&& cd ../ \
&& rm -rf cgicc-3.2.9
# testing with singularity containers found cgi scripts not working and messages
# 'unable to connect to cgi daemon after multiple tries' in /var/log/httpd/errorlog
# This was fixed by switching the MPM event module to the MPM prefork module...
RUN sed -e 's/#LoadModule mpm_prefork_module/LoadModule mpm_prefork_module/' -i /etc/httpd/conf.modules.d/00-mpm.conf \
&& sed -e '/LoadModule mpm_event_module/ s/^#*/#/' -i /etc/httpd/conf.modules.d/00-mpm.conf
RUN echo 'CP=$(type -t cp)' >> /etc/rc.local ;\
echo 'if [ ! -z "${CP}" ] && [ "${CP}" != "file" ]; then unalias cp; fi' >> /etc/rc.local ;\
echo "cp -f /web/httpd.conf /etc/httpd/conf/" >> /etc/rc.local ;\
echo "alias cp='cp -i'" >> /etc/rc.local ;\
echo "chmod a+x /web/SetupDatabase.sh" >> /etc/rc.local ;\
echo "chmod a+x /opt/middleman/run_middleman.sh" >> /etc/rc.local ;\
echo "chmod a+x /opt/middleman/Setup.sh" >> /etc/rc.local ;\
echo 'export LD_LIBRARY_PATH=/lib/:/opt/ToolFrameworkCore/lib:/opt/ToolDAQFramework/lib:/opt/boost_1_66_0/install/lib:/opt/zeromq-4.0.7/lib:/opt/libpqxx-6.4.5/install/lib:$LD_LIBRARY_PATH' >> /etc/rc.local ;\
echo "cd /web && make clean && make" >> /etc/rc.local ;\
echo "cd /web/cgi-bin && make clean && make" >> /etc/rc.local ;\
echo "/web/SetupDatabase.sh" >> /etc/rc.local ;\
echo "/opt/middleman/run_middleman.sh &> /dev/null &" >> /etc/rc.local ;\
echo 'disown $!' >> /etc/rc.local ;\
echo "/web/Win_Mac_translation_server &> /dev/null &" >> /etc/rc.local ;\
echo 'disown $!' >> /etc/rc.local ;\
echo "/web/Trigger_proxy &> /dev/null &" >> /etc/rc.local ;\
echo 'disown $!' >> /etc/rc.local ;\
echo "/web/backgroundSD &> /dev/null &" >> /etc/rc.local ;\
echo 'disown $!' >> /etc/rc.local ;\
echo "httpd -DFOREGROUND" >> /etc/rc.local ;\
chmod +x /etc/rc.local
#ENTRYPOINT ["/bin/bash"]
#CMD ["-c",". /etc/rc.local"]
CMD /bin/bash -c '. /etc/rc.local 2>&1 | tee /web/.rclocal.log'