summaryrefslogtreecommitdiffstats
path: root/mod/distributorapi
diff options
context:
space:
mode:
Diffstat (limited to 'mod/distributorapi')
-rw-r--r--mod/distributorapi/Changelog.md10
-rw-r--r--mod/distributorapi/Dockerfile9
-rw-r--r--mod/distributorapi/distributor/config.py2
-rw-r--r--mod/distributorapi/distributor/http.py2
-rw-r--r--mod/distributorapi/distributor/version.py2
-rw-r--r--mod/distributorapi/pom.xml2
6 files changed, 21 insertions, 6 deletions
diff --git a/mod/distributorapi/Changelog.md b/mod/distributorapi/Changelog.md
new file mode 100644
index 0000000..2e0327b
--- /dev/null
+++ b/mod/distributorapi/Changelog.md
@@ -0,0 +1,10 @@
+# Change Log
+All notable changes to this project will be documented in this file.
+
+The format is based on [Keep a Changelog](http://keepachangelog.com/)
+and this project adheres to [Semantic Versioning](http://semver.org/).
+
+## [1.0.1] - 3/26/2020
+ * Run as non-root
+## [1.0.0] - 11/11/2019
+ * Distributor API - initial version
diff --git a/mod/distributorapi/Dockerfile b/mod/distributorapi/Dockerfile
index cc10c68..f82607d 100644
--- a/mod/distributorapi/Dockerfile
+++ b/mod/distributorapi/Dockerfile
@@ -15,9 +15,14 @@
# ============LICENSE_END=========================================================
FROM python:3.7-alpine
+ARG UID=1000
+ARG GID=1000
COPY . /code
WORKDIR /code
-RUN pip install .
-EXPOSE 80
+RUN pip install . && \
+ addgroup -g $GID dcaemod && \
+ adduser -s /bin/bash -u $UID -G dcaemod -D dcaemod
+USER dcaemod
+EXPOSE 8080
ENV DISTRIBUTOR_DEBUG=0
CMD start-distributor-api
diff --git a/mod/distributorapi/distributor/config.py b/mod/distributorapi/distributor/config.py
index 8d2cede..d83eee1 100644
--- a/mod/distributorapi/distributor/config.py
+++ b/mod/distributorapi/distributor/config.py
@@ -35,4 +35,4 @@ def init():
global onboarding_api_url
onboarding_api_url = _grab_env("ONBOARDING_API_URL"
- , default="http://onboarding-api/onboarding")
+ , default="http://onboarding-api:8080/onboarding")
diff --git a/mod/distributorapi/distributor/http.py b/mod/distributorapi/distributor/http.py
index 963a852..f1aa2fd 100644
--- a/mod/distributorapi/distributor/http.py
+++ b/mod/distributorapi/distributor/http.py
@@ -253,4 +253,4 @@ def start_http_server():
if is_debug():
_app.run(debug=True)
else:
- _app.run(host="0.0.0.0", port=80, debug=False)
+ _app.run(host="0.0.0.0", port=8080, debug=False)
diff --git a/mod/distributorapi/distributor/version.py b/mod/distributorapi/distributor/version.py
index 57c4da3..9da6f0f 100644
--- a/mod/distributorapi/distributor/version.py
+++ b/mod/distributorapi/distributor/version.py
@@ -13,4 +13,4 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ============LICENSE_END=========================================================
-__version__ = "1.0.0"
+__version__ = "1.0.1"
diff --git a/mod/distributorapi/pom.xml b/mod/distributorapi/pom.xml
index 3cfd949..45096b1 100644
--- a/mod/distributorapi/pom.xml
+++ b/mod/distributorapi/pom.xml
@@ -23,7 +23,7 @@ limitations under the License.
<groupId>org.onap.dcaegen2.platform.mod</groupId>
<artifactId>dcaegen2-platform-mod-distributorapi</artifactId>
<!-- NOTE: Must keep this version synchronized with the version in distributor/version.py file -->
- <version>1.0.0</version>
+ <version>1.0.1-SNAPSHOT</version>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<sonar.sources>.</sonar.sources>