summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTony Hansen <tony@att.com>2020-08-17 15:21:16 +0000
committerGerrit Code Review <gerrit@onap.org>2020-08-17 15:21:16 +0000
commit4feffc20485b5bd304d0dc1edb9255c2cc55ed20 (patch)
treeb30e38c02f7e4712c35ffe65c2e34985f00e19f9
parente3d56903975ae17915a618f5f509a6933b315275 (diff)
parent2d223b10ab87c50d6851b3e9d5e1c5f747b85585 (diff)
Merge "Run in Python 3.8"
-rw-r--r--components/pm-subscription-handler/Dockerfile33
-rw-r--r--components/pm-subscription-handler/tox.ini2
2 files changed, 16 insertions, 19 deletions
diff --git a/components/pm-subscription-handler/Dockerfile b/components/pm-subscription-handler/Dockerfile
index 566b2ab9..a30c3484 100644
--- a/components/pm-subscription-handler/Dockerfile
+++ b/components/pm-subscription-handler/Dockerfile
@@ -1,5 +1,6 @@
# ============LICENSE_START===================================================
# Copyright (C) 2020 Nordix Foundation.
+# Copyright 2020 Deutsche Telekom. All rights reserved.
# ============================================================================
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
@@ -16,28 +17,27 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=====================================================
-FROM python:3.7-slim-buster
+FROM python:3.8.2-alpine3.11
MAINTAINER lego@est.tech
-ENV PMSHUSER=pmsh \
- APPDIR="/opt/app/pmsh" \
- # set PATH & PYTHONPATH vars
- PATH=/usr/local/lib/python3.7/bin:$PATH:$APPDIR/bin \
- PYTHONPATH=/usr/local/lib/python3.7/site-packages:./mod:./:$PYTHONPATH:$APPDIR/bin \
+ARG user=onap
+ARG group=onap
+
+WORKDIR /app
+
+# set PATH & PYTHONPATH vars
+ENV PATH=/usr/local/lib/python3.8/bin:$PATH:./bin \
+ PYTHONPATH=/usr/local/lib/python3.8/site-packages:./mod:./:$PYTHONPATH:./bin \
REQUESTS_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \
LOGS_PATH="/var/log/ONAP/dcaegen2/services/pmsh" \
LOGGER_CONFIG=/opt/app/pmsh/log_config.yaml
-WORKDIR $APPDIR
-
# add non root user & group
-RUN addgroup --system $PMSHUSER && adduser --ingroup $PMSHUSER --system $PMSHUSER && \
+RUN addgroup --system $user && adduser --ingroup $user --system $user && \
# create and chown the LOGS_PATH
- apt-get update && \
- apt-get install -y --no-install-recommends vim-tiny && \
- apt-get clean && rm -rf /var/lib/apt/lists/* && \
+ apk add build-base libffi-dev postgresql-dev && \
mkdir -p $LOGS_PATH && \
- chown -R $PMSHUSER:$PMSHUSER $LOGS_PATH
+ chown -R $user:$group $LOGS_PATH
COPY setup.py ./
COPY requirements.txt ./
@@ -49,11 +49,8 @@ RUN pip install --upgrade pip && \
pip install -r requirements.txt && \
pip install -e . && \
# change own & perms on entrypoint
- chown -R $PMSHUSER:$PMSHUSER $APPDIR && \
- chmod 500 $APPDIR/bin/*.py
-
-# set to non root user
-USER $PMSHUSER
+ chown -R $user:$group . && \
+ chmod 500 ./bin/*.py
# run the app
ENTRYPOINT ["python", "./bin/pmsh_service_main.py"] \ No newline at end of file
diff --git a/components/pm-subscription-handler/tox.ini b/components/pm-subscription-handler/tox.ini
index 5ba25d5b..1136f5a3 100644
--- a/components/pm-subscription-handler/tox.ini
+++ b/components/pm-subscription-handler/tox.ini
@@ -17,7 +17,7 @@
# ============LICENSE_END=========================================================
[tox]
-envlist = py36,py37,flake8
+envlist = py36,py37,flake8,py38
skip_missing_interpreters = true
[testenv]