1 # This creates osm/NBI docker from local NBI source code
5 # Set the working directory to /app
8 # Copy the current directory contents into the container at /app
11 RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
12 python3-pymongo python3-yaml python3-pip \
13 && pip3 install pip==9.0.3 \
14 && pip3 install aiokafka cherrypy \
15 && mkdir -p /app/storage/kafka && mkdir -p /app/log
18 RUN git clone https://osm.etsi.org/gerrit/osm/common.git \
19 && cd common && python3 setup.py develop && cd ..
20 # && pip3 install -U -r requirements.txt \
24 RUN pip3 install pyang && mkdir -p /app && cd /app \
25 && git clone https://github.com/robshakir/pyangbind \
26 && pip3 install -e pyangbind \
27 && git clone https://osm.etsi.org/gerrit/osm/IM \
28 && cd /app/IM/models/yang \
29 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/osm_nbi/vnfd_catalog.py vnfd.yang \
30 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/osm_nbi/nsd_catalog.py nsd.yang
34 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
35 Description="This implements a north bound interface for OSM" \
37 Author="Alfonso Tierno"
39 # Used for local storage
44 # The following ENV can be added with "docker run -e xxx' to configure
46 ENV OSMNBI_SOCKET_HOST 0.0.0.0
47 ENV OSMNBI_SOCKET_PORT 9999
49 ENV OSMNBI_STORAGE_PATH /app/storage
51 ENV OSMNBI_DATABASE_DRIVER mongo
52 ENV OSMNBI_DATABASE_HOST mongo
53 ENV OSMNBI_DATABASE_PORT 27017
55 ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
57 ENV OSMNBI_LOG_FILE /app/log
58 ENV OSMNBI_LOG_LEVEL DEBUG
60 ENV OSMNBI_MESSAGE_DRIVER kafka
61 ENV OSMNBI_MESSAGE_HOST kafka
62 ENV OSMNBI_MESSAGE_PORT 9092
64 ENV OSMNBI_LOG_FILE /app/log/nbi.log
65 ENV OSMNBI_LOG_LEVEL DEBUG
67 ENV OSMNBI_AUTHENTICATOR_DB_HOST mysql
68 ENV OSMNBI_AUTHENTICATOR_DB_PORT 3306
69 ENV OSMNBI_AUTHENTICATOR_DB_ROOT_PASSWORD mysql
70 ENV OSMNBI_AUTHENTICATOR_DB_USER mysql
71 ENV OSMNBI_AUTHENTICATOR_DB_PASS mysql
72 ENV OSMNBI_AUTHENTICATOR_BACKEND keystone
73 ENV OSMNBI_AUTHENTICATOR_AUTH_URL keystone
74 ENV OSMNBI_AUTHENTICATOR_USER_DOMAIN_NAME keystone
75 ENV OSMNBI_AUTHENTICATOR_PROJECT_DOMAIN_NAME keystone
76 ENV OSMNBI_AUTHENTICATOR_SERVICE_USERNAME authenticator
77 ENV OSMNBI_AUTHENTICATOR_SERVICE_PASSWORD authenticator
78 ENV OSMNBI_AUTHENTICATOR_SERVICE_PROJECT admin
80 # Run app.py when the container launches
81 CMD ["python3", "nbi.py"]