c76bc90d0547dd031617a6d042308f49497e8f31
[osm/NBI.git] / Dockerfile.local
1 # This creates osm/NBI docker from local NBI source code
2
3 FROM ubuntu:16.04
4
5 # Set the working directory to /app
6 WORKDIR /app/osm_nbi
7
8 # Copy the current directory contents into the container at /app
9 ADD . /app
10
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 
16
17 # OSM_COMMON
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 \
22 #    && cd ..
23
24 # OSM_IM
25 RUN pip3 install pyang && mkdir -p /app && cd /app \
26     && git clone https://github.com/robshakir/pyangbind \
27     && pip3 install -e pyangbind \
28     && git clone  https://osm.etsi.org/gerrit/osm/IM \
29     && cd /app/IM/models/yang \
30     && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/osm_nbi/vnfd_catalog.py vnfd.yang \
31     && pyang --plugindir /app/pyangbind/pyangbind/plugin -f pybind -o /app/osm_nbi/nsd_catalog.py nsd.yang
32
33 EXPOSE 9999
34
35 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
36       Description="This implements a north bound interface for OSM" \
37       Version="1.0" \
38       Author="Alfonso Tierno"
39
40 # Used for local storage
41 VOLUME /app/storage
42 # Used for logs
43 VOLUME /app/log
44
45 # The following ENV can be added with "docker run -e xxx' to configure
46 # server
47 ENV OSMNBI_SOCKET_HOST                          0.0.0.0
48 ENV OSMNBI_SOCKET_PORT                          9999
49 # storage
50 ENV OSMNBI_STORAGE_PATH                         /app/storage
51 # database
52 ENV OSMNBI_DATABASE_DRIVER                      mongo
53 ENV OSMNBI_DATABASE_HOST                        mongo
54 ENV OSMNBI_DATABASE_PORT                        27017
55 # ENV OSMNBI_DATABASE_USER                      xxx
56 # ENV OSMNBI_DATABASE_PASSWORD                  xxx
57 # ENV OSMNBI_DATABASE_MASTERPASSWORD            xxx
58 # web
59 ENV OSMNBI_STATIC_DIR                           /app/osm_nbi/html_public
60 # logs
61 ENV OSMNBI_LOG_FILE                             /app/log
62 ENV OSMNBI_LOG_LEVEL                            DEBUG
63 # message
64 ENV OSMNBI_MESSAGE_DRIVER                       kafka
65 ENV OSMNBI_MESSAGE_HOST                         kafka
66 ENV OSMNBI_MESSAGE_PORT                         9092
67 # logs
68 ENV OSMNBI_LOG_FILE                             /app/log/nbi.log
69 ENV OSMNBI_LOG_LEVEL                            DEBUG
70 # authentication
71 ENV OSMNBI_AUTHENTICATION_BACKEND               internal
72 #ENV OSMNBI_AUTHENTICATION_BACKEND               keystone
73 #ENV OSMNBI_AUTHENTICATION_AUTH_URL              keystone
74 #ENV OSMNBI_AUTHENTICATION_AUTH_PORT             5000
75 #ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME      default
76 #ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME   default
77 #ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME      nbi
78 #ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD      nbi
79 #ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT       service
80
81 # Run app.py when the container launches
82 CMD ["python3", "nbi.py"]
83