summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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]