Repair Portal defects; upgrade Docker build.
[portal.git] / deliveries / Dockerfile.portalapps
1 # Dockerfile for image with ONAP applications:
2 # Portal app, Portal-SDK app, Portal-DBC app.
3
4 FROM openjdk:8-jdk
5
6 # Arguments are supplied by build.sh script
7 # the defaults below only support testing
8 ARG PORTAL_WAR=build/ecompportal-be-os.war
9 ARG FE_DIR=build/public
10 ARG SDK_WAR=build/epsdk-app-os.war
11 ARG DBC_WAR=build/dmaap-bc-app-os.war
12 ARG HTTP_PROXY
13 ARG HTTPS_PROXY
14
15 # This is just a variable, never passed in
16 ARG TOMCATHOME=/opt/apache-tomcat-8.0.37
17
18 ENV http_proxy $HTTP_PROXY
19 ENV https_proxy $HTTPS_PROXY
20 RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
21     if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
22
23 # Install Tomcat; curl is already part of this image
24 WORKDIR /tmp
25 RUN curl -s -O https://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
26 RUN tar -xzf apache-tomcat-8.0.37.tar.gz
27 # Remove manager and sample apps
28 RUN rm -fr apache-tomcat-8.0.37/webapps/[a-z]*
29 RUN mv apache-tomcat-8.0.37 /opt
30
31 WORKDIR ${TOMCATHOME}/webapps
32 RUN mkdir ECOMPPORTAL && mkdir ECOMPSDKAPP && mkdir ECOMPDBCAPP
33
34 # Portal has many parts
35 COPY $PORTAL_WAR ECOMPPORTAL
36 RUN cd ECOMPPORTAL && unzip -q *.war && rm *.war
37 COPY ${FE_DIR} ECOMPPORTAL/public
38
39 # SDK app has only a war
40 COPY $SDK_WAR ECOMPSDKAPP
41 RUN cd ECOMPSDKAPP && unzip -q *.war && rm *.war
42
43 # DBC app has only a war
44 COPY $DBC_WAR ECOMPDBCAPP
45 RUN cd ECOMPDBCAPP && unzip -q *.war && rm *.war
46
47 VOLUME ${TOMCATHOME}/logs
48
49 # Define commonly used ENV variables
50 ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
51 COPY configure-and-run.sh /
52
53 # Define default command.
54 CMD ["/configure-and-run.sh"]