-
Notifications
You must be signed in to change notification settings - Fork 8
Expand file tree
/
Copy pathDockerfile.server
More file actions
79 lines (72 loc) · 3.47 KB
/
Dockerfile.server
File metadata and controls
79 lines (72 loc) · 3.47 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
79
# server image
FROM tooldaq/web_base
RUN yum install -y \
httpd \
postgresql-server \
postgresql-devel \
libpq-devel \
sudo \
procps-ng \
psmisc \
emacs \
iputils \
iproute \
&& yum clean all \
&& rm -rf /var/cache/yum
RUN cd /opt \
&& wget https://github.com/jtv/libpqxx/archive/refs/tags/7.10.4.tar.gz \
&& tar zxvf 7.10.4.tar.gz \
&& rm 7.10.4.tar.gz \
&& cd libpqxx-7.10.4 \
&& mkdir install \
&& ./configure --disable-documentation --enable-shared --prefix=/opt/libpqxx-7.10.4/install CXXFLAGS=-O3 \
&& if [ ! -f /usr/bin/python ]; then ln -s /usr/bin/python3 /usr/bin/python; fi \
&& make -j`nproc --all` \
&& make install
RUN cd /opt \
&& git clone https://github.com/ToolDAQ/middleman_v2.git middleman \
&& cd middleman/ \
&& . ./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 'cd /opt/ToolFrameworkCore && git pull && make clean && make -j$(nproc)' >> /etc/rc.local ;\
echo 'cd /opt/ToolDAQFramework && git pull && make clean && make -j$(nproc)' >> /etc/rc.local ;\
echo 'cd /opt/middleman && git pull && . Setup.sh && make clean && make -j$(nproc)' >> /etc/rc.local ;\
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 '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-7.10.4/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 "chmod a+x /opt/middleman/run_middleman.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" >> /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'