17677aa813ffcfadf7014d40c1535b56c8b50a61
[portal.git] / deliveries / Dockerfile.portalapps
1 # Dockerfile for image with ONAP applications:
2 # Portal app, Portal-SDK 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 HTTP_PROXY
15 ARG HTTPS_PROXY
16
17 # Just variables, never passed in
18 ARG TOMCAT=apache-tomcat-8.0.37
19 ARG TOMCATTAR=${TOMCAT}.tar.gz
20 ARG TOMCATHOME=/opt/${TOMCAT}
21 ARG PORTALCONTEXT=ONAPPORTAL
22 ARG SDKCONTEXT=ONAPPORTALSDK
23
24 ENV http_proxy $HTTP_PROXY
25 ENV https_proxy $HTTPS_PROXY
26 RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
27     if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
28
29 # Install Tomcat.  This image already has curl.
30 WORKDIR /tmp
31 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v8.0.37/bin/apache-tomcat-8.0.37.tar.gz
32 RUN tar -xzf ${TOMCATTAR}
33 RUN rm ${TOMCATTAR}
34 # Remove manager and sample apps
35 RUN rm -fr ${TOMCAT}/webapps/[a-z]*
36 RUN mkdir -p /opt
37 RUN mv ${TOMCAT} /opt
38
39 WORKDIR ${TOMCATHOME}/webapps
40 RUN mkdir ${PORTALCONTEXT} && mkdir ${SDKCONTEXT}
41
42 # Portal has many parts
43 COPY $PORTAL_WAR ${PORTALCONTEXT}
44 RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
45 COPY ${FE_DIR} ${PORTALCONTEXT}/public
46
47 # SDK app has only a war
48 COPY $SDK_WAR ${SDKCONTEXT}
49 RUN cd ${SDKCONTEXT} && unzip -q *.war && rm *.war
50
51 VOLUME ${TOMCATHOME}/logs
52
53 # Switch back to root
54 WORKDIR /
55
56 # Define commonly used ENV variables
57 ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
58 # Install the wait script
59 COPY wait-for.sh /
60 # Install the launch script
61 COPY start-apps-cmd.sh /
62
63 # Define default command
64 CMD /start-apps-cmd.sh