Extend deployment for CSIT env quirks
[portal.git] / deliveries / Dockerfile.portalapps
1 # Dockerfile for image with ONAP applications:
2 # Portal app, Portal-SDK app, Portal-DBC app.
3
4 # Yields an image 823 MB
5 FROM frolvlad/alpine-oraclejdk8:slim
6 # Yields an image 1.4 GB
7 # FROM openjdk:8-jdk
8
9 # Arguments are supplied by build.sh script
10 # the defaults below only support testing
11 ARG PORTAL_WAR=build/ecompportal-be-os.war
12 ARG FE_DIR=build/public
13 ARG SDK_WAR=build/epsdk-app-os.war
14 ARG DBC_WAR=build/dmaap-bc-app-os.war
15 ARG HTTP_PROXY
16 ARG HTTPS_PROXY
17
18 # Just variables, never passed in
19 ARG TOMCAT=apache-tomcat-8.0.37
20 ARG TOMCATTAR=${TOMCAT}.tar.gz
21 ARG TOMCATHOME=/opt/${TOMCAT}
22
23 ENV http_proxy $HTTP_PROXY
24 ENV https_proxy $HTTPS_PROXY
25 RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
26     if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
27
28 # Install Tomcat.  This image already has curl.
29 WORKDIR /tmp
30 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
31 RUN tar -xzf ${TOMCATTAR}
32 RUN rm ${TOMCATTAR}
33 # Remove manager and sample apps
34 RUN rm -fr ${TOMCAT}/webapps/[a-z]*
35 RUN mkdir -p /opt
36 RUN mv ${TOMCAT} /opt
37
38 WORKDIR ${TOMCATHOME}/webapps
39 RUN mkdir ECOMPPORTAL && mkdir ECOMPSDKAPP && mkdir ECOMPDBCAPP
40
41 # Portal has many parts
42 COPY $PORTAL_WAR ECOMPPORTAL
43 RUN cd ECOMPPORTAL && unzip -q *.war && rm *.war
44 COPY ${FE_DIR} ECOMPPORTAL/public
45
46 # SDK app has only a war
47 COPY $SDK_WAR ECOMPSDKAPP
48 RUN cd ECOMPSDKAPP && unzip -q *.war && rm *.war
49
50 # DBC app has only a war
51 COPY $DBC_WAR ECOMPDBCAPP
52 RUN cd ECOMPDBCAPP && unzip -q *.war && rm *.war
53
54 VOLUME ${TOMCATHOME}/logs
55
56 # Switch back to root
57 WORKDIR /
58
59 # Define commonly used ENV variables
60 ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
61 # Install the wait script
62 COPY wait-for.sh /
63 # Install the launch script
64 COPY start-apps-cmd.sh /
65
66 # Define default command
67 CMD /start-apps-cmd.sh