1 # This creates osm/NBI docker from local NBI source code
5 # Set the working directory to /app
6 WORKDIR /app/NBI/osm_nbi
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 python3-keystoneclient \
13 && pip3 install pip==9.0.3 \
14 && pip3 install aiokafka cherrypy==18.0.0 keystoneauth1 \
15 && mkdir -p /app/storage/kafka && mkdir -p /app/log
18 RUN git clone https://osm.etsi.org/gerrit/osm/common.git \
19 && pip3 install -e common
20 # && cd common && python3 setup.py develop && cd ..
21 # && pip3 install -U -r requirements.txt \
25 RUN pip3 install pyang && mkdir -p /app && cd /app \
26 && git -C /app clone https://github.com/robshakir/pyangbind \
27 && pip3 install -e /app/pyangbind \
28 && git -C /app clone https://osm.etsi.org/gerrit/osm/IM \
29 && cd /app/IM/models/yang \
30 && mkdir /app/IM/osm_im \
31 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/IM/osm_im/vnfd.py vnfd.yang \
32 && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/IM/osm_im/nsd.py nsd.yang \
33 && pip3 install -e /app/IM
37 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
38 Description="This implements a north bound interface for OSM" \
40 Author="Alfonso Tierno"
42 # Used for local storage
47 # The following ENV can be added with "docker run -e xxx' to configure
49 ENV OSMNBI_SOCKET_HOST 0.0.0.0
50 ENV OSMNBI_SOCKET_PORT 9999
52 ENV OSMNBI_STORAGE_PATH /app/storage
54 ENV OSMNBI_DATABASE_DRIVER mongo
55 ENV OSMNBI_DATABASE_HOST mongo
56 ENV OSMNBI_DATABASE_PORT 27017
57 # ENV OSMNBI_DATABASE_USER xxx
58 # ENV OSMNBI_DATABASE_PASSWORD xxx
59 # ENV OSMNBI_DATABASE_MASTERPASSWORD xxx
61 ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
63 ENV OSMNBI_LOG_FILE /app/log
64 ENV OSMNBI_LOG_LEVEL DEBUG
66 ENV OSMNBI_MESSAGE_DRIVER kafka
67 ENV OSMNBI_MESSAGE_HOST kafka
68 ENV OSMNBI_MESSAGE_PORT 9092
70 ENV OSMNBI_LOG_FILE /app/log/nbi.log
71 ENV OSMNBI_LOG_LEVEL DEBUG
73 ENV OSMNBI_AUTHENTICATION_BACKEND internal
74 #ENV OSMNBI_AUTHENTICATION_BACKEND keystone
75 #ENV OSMNBI_AUTHENTICATION_AUTH_URL keystone
76 #ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000
77 #ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default
78 #ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default
79 #ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi
80 #ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi
81 #ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service
83 # Run app.py when the container launches
84 CMD ["python3", "nbi.py"]