-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathDockerfile-nsiws
More file actions
50 lines (41 loc) · 2.48 KB
/
Dockerfile-nsiws
File metadata and controls
50 lines (41 loc) · 2.48 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
# Etape 1 : Télechargement du livrable applicatif
FROM ubuntu AS build
RUN apt-get update
RUN apt-get --assume-yes install curl
RUN mkdir nsiws
WORKDIR nsiws
RUN curl https://circabc.europa.eu/sd/a/59572cfe-2973-4ad2-940b-9f56d110f0df/SRI_Web_Service_Java_v8.0.12-20211208.zip --output nsiws.zip
RUN apt-get install unzip
RUN unzip nsiws.zip
RUN ls
RUN ls SRI_Web_Service_Java_v8.0.12-20211208/app
FROM tomcat:9-jre8-openjdk
# Installation du certificat
COPY conf/fake-certificate-cert.pem /usr/local/tomcat/ssl/fake-certificate-cert.pem
COPY conf/fake-certificate-key.pem /usr/local/tomcat/ssl/fake-certificate-key.pem
COPY conf/server.xml /usr/local/tomcat/conf/server.xml
# Installation de metro-standalone
RUN apt update
RUN apt install -y ant
RUN curl https://maven.java.net/content/repositories/releases//org/glassfish/metro/metro-standalone/2.3.1/metro-standalone-2.3.1.zip --output metro-standalone.zip
RUN unzip metro-standalone.zip
RUN ant -Dtomcat.home=/usr/local/tomcat/ -f metro/metro-on-tomcat.xml install
# Installation de l'application
COPY --from=build nsiws/SRI_Web_Service_Java_v8.0.12-20211208/app/nsi-jax-ws.war /usr/local/tomcat/webapps/ROOT.war
COPY --from=build nsiws/SRI_Web_Service_Java_v8.0.12-20211208/app/nsiws-params /usr/local/tomcat/classpath/nsiws-params
COPY --from=build nsiws/SRI_Web_Service_Java_v8.0.12-20211208/app/plugins /usr/local/tomcat/classpath/plugins
RUN echo "# Add classpath to Tomcat CLASSPATH" > /usr/local/tomcat/bin/setenv.sh
RUN echo "CLASSPATH=/usr/local/tomcat/classpath/" >> /usr/local/tomcat/bin/setenv.sh
RUN sed -i 's+plugins.path=+plugins.path=/usr/local/tomcat/classpath/plugins/+g' /usr/local/tomcat/classpath/nsiws-params/nsi_plugins.properties
RUN chmod 750 /usr/local/tomcat/bin/setenv.sh
# Tomcat configuration
RUN echo 'MODIFICATION DU CONTEXT.XML'
RUN sed -i '\#^</Context>#i\
<ResourceLink name="jdbc/mastore" global="org.estat.sri.MySqlMappingStore" type="javax.sql.DataSource"/> \n \
<ResourceLink name="jdbc/authdb" global="org.estat.sri.MySqlAuthDb" type="javax.sql.DataSource"/>' /usr/local/tomcat/conf/context.xml
COPY --from=build nsiws/SRI_Web_Service_Java_v8.0.12-20211208/app/jdbc-drivers /usr/local/tomcat/lib
COPY --from=build nsiws/SRI_Web_Service_Java_v8.0.12-20211208/lib/jersey-bundle-1.19.1.jar /usr/local/tomcat/lib
RUN echo 'MODIFICATION DU SERVER.XML'
ADD script.sh /usr/local/tomcat/script.sh
RUN chmod +x /usr/local/tomcat/script.sh
ENTRYPOINT ["/usr/local/tomcat/script.sh"]