-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
45 lines (39 loc) · 2.16 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
FROM tomcat:9-jre11-slim
LABEL maintainer="Esteban Puentes <[email protected]>"
RUN apt-get update -y && \
apt-get install -y --no-install-recommends \
openjdk-11-jdk-headless ant git patch wget xmlstarlet && \
cd /tmp && \
wget https://github.com/cern-drawio/drawio/archive/v${VERSION}.zip && \
unzip v${VERSION}.zip && \
cd /tmp/drawio-${VERSION}/etc/build && \
ant war && \
cd /tmp/drawio-${VERSION}/build && \
unzip /tmp/drawio-${VERSION}/build/draw.war -d $CATALINA_HOME/webapps/draw && \
apt-get remove -y --purge openjdk-11-jdk-headless ant git patch wget && \
apt-get autoremove -y --purge && \
apt-get clean && \
rm -rf \
/var/lib/apt/lists/* \
/tmp/v${VERSION}.zip \
/tmp/drawio-${VERSION}
# Update server.xml to set Draw.io webapp to root
RUN cd $CATALINA_HOME && \
xmlstarlet ed \
-P -S -L \
-i '/Server/Service/Engine/Host/Valve' -t 'elem' -n 'Context' \
-i '/Server/Service/Engine/Host/Context' -t 'attr' -n 'path' -v '/' \
-i '/Server/Service/Engine/Host/Context[@path="/"]' -t 'attr' -n 'docBase' -v 'draw' \
-s '/Server/Service/Engine/Host/Context[@path="/"]' -t 'elem' -n 'WatchedResource' -v 'WEB-INF/web.xml' \
-i '/Server/Service/Engine/Host/Valve' -t 'elem' -n 'Context' \
-i '/Server/Service/Engine/Host/Context[not(@path="/")]' -t 'attr' -n 'path' -v '/ROOT' \
-s '/Server/Service/Engine/Host/Context[@path="/ROOT"]' -t 'attr' -n 'docBase' -v 'ROOT' \
-s '/Server/Service/Engine/Host/Context[@path="/ROOT"]' -t 'elem' -n 'WatchedResource' -v 'WEB-INF/web.xml' \
# -s '/Server/Service/Engine/Host' -t 'elem' -n 'Valve' \
# -s '/Server/Service/Engine/Host/Valve[not(@directory="logs")]' -t 'attr' -n 'className' -v 'org.apache.catalina.valves.RemoteHostValve' \
# -s '/Server/Service/Engine/Host/Valve[not(@directory="logs")]' -t 'attr' -n 'allow' -v 'oostandarddev\-.*\.cern\.ch|oostandardprod\-.*\.cern\.ch|pcitcda30\.dyndns\.cern\.ch|macitcda30\.dyndns\.cern\.ch' \
# -s '/Server/Service/Connector[@port="8080"]' -t 'attr' -n 'enableLookups' -v 'true' \
conf/server.xml
WORKDIR $CATALINA_HOME
EXPOSE 8080
ENTRYPOINT ["catalina.sh", "run"]