blob: 9c3e245bbf76a20af0c3784b2423ccce2cc57a5d [file] [log] [blame]
tiernod125caf2018-11-22 16:05:54 +00001# 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
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
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
10# implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
tierno533f64d2018-11-28 10:18:41 +000014# This creates osm/NBI docker from from last stable package
tiernoa8d63632018-05-10 13:12:32 +020015
16FROM ubuntu:16.04
17
tierno0c01ffa2018-11-19 14:39:33 +010018ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
19ARG RELEASE=ReleaseFIVE
20ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
Philippe Coval9fe58b12019-10-30 14:42:36 +010021ARG REPOSITORY=stable
tierno0c01ffa2018-11-19 14:39:33 +010022
23RUN apt-get update && apt-get install -y curl software-properties-common
24RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
25RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update
26
27RUN apt-get -y install python3-osm-nbi
28
tiernoa8d63632018-05-10 13:12:32 +020029# Set the working directory to /app
30WORKDIR /app/osm_nbi
31
tierno0c01ffa2018-11-19 14:39:33 +010032RUN 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/
tiernoa8d63632018-05-10 13:12:32 +020035
36EXPOSE 9999
37
38LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
39 Description="This implements a north bound interface for OSM" \
40 Version="1.0" \
41 Author="Alfonso Tierno"
42
43# Used for local storage
44VOLUME /app/storage
45# Used for logs
46VOLUME /app/log
47
48# The following ENV can be added with "docker run -e xxx' to configure
49# server
50ENV OSMNBI_SOCKET_HOST 0.0.0.0
51ENV OSMNBI_SOCKET_PORT 9999
52# storage
53ENV OSMNBI_STORAGE_PATH /app/storage
54# database
55ENV OSMNBI_DATABASE_DRIVER mongo
tierno0c01ffa2018-11-19 14:39:33 +010056ENV OSMNBI_DATABASE_URI mongodb://mongo:27017
tiernoa8d63632018-05-10 13:12:32 +020057# web
58ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
59# logs
tierno0c01ffa2018-11-19 14:39:33 +010060# ENV OSMNBI_LOG_FILE /app/log
tiernoa8d63632018-05-10 13:12:32 +020061ENV OSMNBI_LOG_LEVEL DEBUG
62# message
63ENV OSMNBI_MESSAGE_DRIVER kafka
64ENV OSMNBI_MESSAGE_HOST kafka
65ENV OSMNBI_MESSAGE_PORT 9092
tierno0c01ffa2018-11-19 14:39:33 +010066# authentication
67ENV OSMNBI_AUTHENTICATION_BACKEND internal
68#ENV OSMNBI_AUTHENTICATION_BACKEND keystone
69#ENV OSMNBI_AUTHENTICATION_AUTH_URL keystone
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
tiernoa8d63632018-05-10 13:12:32 +020076
77# Run app.py when the container launches
tierno0c01ffa2018-11-19 14:39:33 +010078CMD ["python3", "/usr/lib/python3/dist-packages/osm_nbi/nbi.py"]
79
80HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
81 CMD curl -k https://localhost:9999/osm/ | grep Welcome || exit 1
tiernoa8d63632018-05-10 13:12:32 +020082