summaryrefslogtreecommitdiffstats
path: root/deliveries/Dockerfile.portal
blob: b4c759fae5e2169fb4f1396c9d4354f0820aba00 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Dockerfile for image with ONAP Portal

# Multistage to be able to have SDK war content and not war itself
FROM busybox:latest AS war-decompress

# Arguments are supplied by build.sh script
# the defaults below only support testing
ARG PORTAL_WAR=build/ecompportal-be-os.war
ARG FE_DIR=build/public

# Just variables, never passed in
ARG PORTALCONTEXT=ONAPPORTAL

RUN mkdir ${PORTALCONTEXT}

# Portal has many parts
COPY $PORTAL_WAR ${PORTALCONTEXT}
RUN cd ${PORTALCONTEXT} && unzip -q *.war && rm *.war
COPY ${FE_DIR} ${PORTALCONTEXT}/public

# Yields an image 823 MB
FROM openjdk:8-alpine
# Yields an image 1.4 GB
# FROM openjdk:8-jdk

# Arguments are supplied by build.sh script
# the defaults below only support testing
ARG PORTAL_WAR=build/ecompportal-be-os.war
ARG FE_DIR=build/public
ARG HTTP_PROXY
ARG HTTPS_PROXY
# ARG PORTAL_CERT=truststoreONAPall.jks

# Just variables, never passed in
ARG TOMCAT_VERSION=8.0.37
ARG TOMCAT=apache-tomcat-${TOMCAT_VERSION}
ARG TOMCATTAR=${TOMCAT}.tar.gz
ARG TOMCATHOME=/opt/${TOMCAT}
ARG PORTALCONTEXT=ONAPPORTAL

ENV http_proxy $HTTP_PROXY
ENV https_proxy $HTTPS_PROXY
RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy  \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
    if [ ! -z ${HTTPS_PROXY} ]; then echo "Acquire::https::proxy \"${HTTPS_PROXY}\";" >> /etc/apt/apt.conf; fi

# Install Tomcat.  This image already has curl.
WORKDIR /tmp
RUN wget -q http://archive.apache.org/dist/tomcat/tomcat-8/v${TOMCAT_VERSION}/bin/${TOMCATTAR} && \
    tar -xzf ${TOMCATTAR} && \
    rm ${TOMCATTAR} &&\
    rm -fr ${TOMCAT}/webapps/* &&\
    mkdir -p /opt &&\
    mv ${TOMCAT} /opt

COPY --from=war-decompress /${PORTALCONTEXT} ${TOMCATHOME}/webapps/${PORTALCONTEXT}/

VOLUME ${TOMCATHOME}/logs

# Switch back to root
WORKDIR /

# Define commonly used ENV variables
ENV PATH $PATH:$JAVA_HOME/bin:${TOMCATHOME}/bin
# Install the launch script
COPY start-apache-tomcat.sh /

# Define default command
CMD /start-apache-tomcat.sh