Merge "Portal Spring Boot Development"
[portal.git] / deliveries / Dockerfile.portal
1 # Dockerfile for image with ONAP Portal
2
3 # Multistage to be able to have SDK war content and not war itself
4 FROM busybox:latest AS war-decompress
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
11 # Just variables, never passed in
12 ARG PORTALCONTEXT=ONAPPORTAL
13
14 RUN mkdir ${PORTALCONTEXT}
15
16 # Portal has many parts
17 COPY $PORTAL_WAR ${PORTALCONTEXT}
18 RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
19 COPY ${FE_DIR} ${PORTALCONTEXT}/public
20
21 # Yields an image 823 MB
22 FROM openjdk:8-alpine
23 # Yields an image 1.4 GB
24 # FROM openjdk:8-jdk
25
26 # Arguments are supplied by build.sh script
27 # the defaults below only support testing
28 ARG PORTAL_WAR=build/ecompportal-be-os.war
29 ARG FE_DIR=build/public
30 ARG HTTP_PROXY
31 ARG HTTPS_PROXY
32 # ARG PORTAL_CERT=truststoreONAPall.jks
33
34 # Just variables, never passed in
35 ARG TOMCAT_VERSION=8.0.37
36 ARG TOMCAT=apache-tomcat-${TOMCAT_VERSION}
37 ARG TOMCATTAR=${TOMCAT}.tar.gz
38 ARG TOMCATHOME=/opt/${TOMCAT}
39 ARG PORTALCONTEXT=ONAPPORTAL
40
41 ENV http_proxy $HTTP_PROXY
42 ENV https_proxy $HTTPS_PROXY
43 RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
44     if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi
45
46 # Install Tomcat.  This image already has curl.
47 WORKDIR /tmp
48 RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/${TOMCATTAR} && \
49     tar -xzf ${TOMCATTAR} && \
50     rm ${TOMCATTAR} &&\
51     rm -fr ${TOMCAT}/webapps/* &&\
52     mkdir -p /opt &&\
53     mv ${TOMCAT} /opt
54
55 COPY --from=war-decompress /${PORTALCONTEXT} ${TOMCATHOME}/webapps/${PORTALCONTEXT}/
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 # Install the launch script
65 COPY start-apache-tomcat.sh /
66
67 # Define default command
68 CMD /start-apache-tomcat.sh