Deliver centralized role management feature
[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 the wait script
29 COPY wait-for.sh /
30
31 # Install Tomcat.  This image already has curl.
32 WORKDIR /tmp
33 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
34 RUN tar -xzf ${TOMCATTAR}
35 RUN rm ${TOMCATTAR}
36 # Remove manager and sample apps
37 RUN rm -fr ${TOMCAT}/webapps/[a-z]*
38 RUN mkdir -p /opt
39 RUN mv ${TOMCAT} /opt
40
41 WORKDIR ${TOMCATHOME}/webapps
42 RUN mkdir ECOMPPORTAL && mkdir ECOMPSDKAPP && mkdir ECOMPDBCAPP
43
44 # Portal has many parts
45 COPY $PORTAL_WAR ECOMPPORTAL
46 RUN cd ECOMPPORTAL && unzip -q *.war && rm *.war
47 COPY ${FE_DIR} ECOMPPORTAL/public
48
49 # SDK app has only a war
50 COPY $SDK_WAR ECOMPSDKAPP
51 RUN cd ECOMPSDKAPP && unzip -q *.war && rm *.war
52
53 # DBC app has only a war
54 COPY $DBC_WAR ECOMPDBCAPP
55 RUN cd ECOMPDBCAPP && unzip -q *.war && rm *.war
56
57 VOLUME ${TOMCATHOME}/logs
58
59 # Switch back to root
60 WORKDIR /
61
62 # Define commonly used ENV variables
63 ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
64 COPY start-apps-cmd.sh /
65
66 # Define default command.
67 CMD /start-apps-cmd.sh