Remove python2.7 from has image
[optf/has.git] / conductor / docker / Dockerfile
1 # -------------------------------------------------------------------------
2 #   Copyright (c) 2015-2017 AT&T Intellectual Property
3 #
4 #   Licensed under the Apache License, Version 2.0 (the "License");
5 #   you may not use this file except in compliance with the License.
6 #   You may obtain a copy of the License at
7 #
8 #       http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #   Unless required by applicable law or agreed to in writing, software
11 #   distributed under the License is distributed on an "AS IS" BASIS,
12 #   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #   See the License for the specific language governing permissions and
14 #   limitations under the License.
15 #
16 # -------------------------------------------------------------------------
17
18 FROM nexus3.onap.org:10001/onap/integration-python:7.0.1
19
20
21 ARG MVN_ARTIFACT_VERSION
22 ARG REPO
23 ARG HTTP_PROXY=${HTTP_PROXY}
24 ARG HTTPS_PROXY=${HTTPS_PROXY}
25
26 ENV http_proxy $HTTP_PROXY
27 ENV https_proxy $HTTPS_PROXY
28 ENV CON_ADDR "127.0.0.1"
29 ENV CON_PORT "8091"
30 EXPOSE ${CON_PORT}
31 ENV APP_USER "onap"
32 ENV APP_GROUP "onap"
33
34 USER root
35
36 # Creete the required directories
37 RUN mkdir -p /etc/nginx/ssl && \
38     mkdir -p /var/log/conductor && \
39     mkdir -p /run/conductor
40
41 # Install the required libraries
42 RUN apk --update add unzip && \
43     apk add curl && \
44     apk add wget && \
45     apk add fcgiwrap && \
46     apk add bash vim && \
47     pip install --no-cache-dir --upgrade pip && \
48     apk add --virtual build-dependencies build-base linux-headers pcre-dev libffi-dev libxslt-dev libressl-dev && \
49     pip install --no-cache-dir uwsgi
50
51 # Get, Install, cleanup and setup
52 COPY onap-has-tm/optf-has-conductor-${MVN_ARTIFACT_VERSION}.zip /tmp/optf-has.zip
53 RUN unzip -q -o -B /tmp/optf-has.zip -d /opt/has && rm -f /tmp/optf-has.zip
54
55 #PKG-INFO file must also exists in the conductor folder (i.e. besides and inside the of_has.egg-info folder). The zip file for distro above is missing it
56 RUN cp /opt/has/conductor/of_has.egg-info/PKG-INFO /opt/has/conductor
57 RUN pip install --no-cache-dir -e /opt/has/conductor
58 COPY app.wsgi /etc/nginx/conductor.wsgi
59 COPY api_paste.ini /usr/local/etc/conductor/api_paste.ini
60
61 # Set ownership to application user
62 RUN chown $APP_USER:$APP_GROUP -R /opt/has/ /var/log/ /run/conductor
63 USER $APP_USER