1 # Licensed under the Apache License, Version 2.0 (the "License");
2 # you may not use this file except in compliance with the License.
3 # You may obtain a copy of the License at
5 # http://www.apache.org/licenses/LICENSE-2.0
7 # Unless required by applicable law or agreed to in writing, software
8 # distributed under the License is distributed on an "AS IS" BASIS,
9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
11 # See the License for the specific language governing permissions and
12 # limitations under the License.
14 # This creates osm/NBI docker from from last stable package
18 ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
19 ARG RELEASE=ReleaseFIVE
20 ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
23 RUN apt-get update && apt-get install -y curl software-properties-common
24 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
25 RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update
27 RUN apt-get -y install python3-osm-nbi
29 # Set the working directory to /app
32 RUN cp -R /usr/lib/python3/dist-packages/osm_nbi/html_public /app/osm_nbi/html_public \
33 && cp /usr/lib/python3/dist-packages/osm_nbi/nbi.cfg /app/osm_nbi/ \
34 && cp -R /usr/lib/python3/dist-packages/osm_nbi/http /app/osm_nbi/
38 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
39 Description="This implements a north bound interface for OSM" \
41 Author="Alfonso Tierno"
43 # Used for local storage
48 # The following ENV can be added with "docker run -e xxx' to configure
50 ENV OSMNBI_SOCKET_HOST 0.0.0.0
51 ENV OSMNBI_SOCKET_PORT 9999
53 ENV OSMNBI_STORAGE_PATH /app/storage
55 ENV OSMNBI_DATABASE_DRIVER mongo
56 ENV OSMNBI_DATABASE_URI mongodb://mongo:27017
58 ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
60 # ENV OSMNBI_LOG_FILE /app/log
61 ENV OSMNBI_LOG_LEVEL DEBUG
63 ENV OSMNBI_MESSAGE_DRIVER kafka
64 ENV OSMNBI_MESSAGE_HOST kafka
65 ENV OSMNBI_MESSAGE_PORT 9092
67 ENV OSMNBI_AUTHENTICATION_BACKEND internal
68 #ENV OSMNBI_AUTHENTICATION_BACKEND keystone
69 #ENV OSMNBI_AUTHENTICATION_AUTH_URL http://keystone:5000/v3
70 #ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000
71 #ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default
72 #ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default
73 #ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi
74 #ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi
75 #ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service
77 # Run app.py when the container launches
78 CMD ["python3", "/usr/lib/python3/dist-packages/osm_nbi/nbi.py"]
80 HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
81 CMD curl -k https://localhost:9999/osm/ | grep Welcome || exit 1