blob: f3512c9f9893e08688771a3621b7f658a8729c2a [file] [log] [blame]
tiernoa8d63632018-05-10 13:12:32 +02001# This creates osm/NBI docker from local NBI source code
2
Mike Marchettic678d042018-04-18 13:51:27 -04003FROM ubuntu:16.04
4
5# Set the working directory to /app
6WORKDIR /app/osm_nbi
7
8# Copy the current directory contents into the container at /app
9ADD . /app
10
tiernoa8d63632018-05-10 13:12:32 +020011RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
tiernoaae4dc42018-06-11 18:55:50 +020012 python3-pymongo python3-yaml python3-pip \
Mike Marchettic678d042018-04-18 13:51:27 -040013 && pip3 install pip==9.0.3 \
tiernoaae4dc42018-06-11 18:55:50 +020014 && pip3 install aiokafka cherrypy \
Mike Marchettic678d042018-04-18 13:51:27 -040015 && mkdir -p /app/storage/kafka && mkdir -p /app/log
tiernoaae4dc42018-06-11 18:55:50 +020016
17# OSM_COMMON
tiernoa8d63632018-05-10 13:12:32 +020018RUN git clone https://osm.etsi.org/gerrit/osm/common.git \
garciadeblas9de57442018-10-02 12:34:18 +020019 && cd common && git checkout v4.0 && python3 setup.py develop && cd ..
tiernoa8d63632018-05-10 13:12:32 +020020# && pip3 install -U -r requirements.txt \
21# && cd ..
22
tiernoaae4dc42018-06-11 18:55:50 +020023# OSM_IM
24RUN 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 \
garciadeblas9de57442018-10-02 12:34:18 +020028 && git -C IM checkout v4.0 \
tiernoaae4dc42018-06-11 18:55:50 +020029 && 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
Mike Marchettic678d042018-04-18 13:51:27 -040032
33EXPOSE 9999
34
35LABEL 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
41VOLUME /app/storage
42# Used for logs
43VOLUME /app/log
44
45# The following ENV can be added with "docker run -e xxx' to configure
46# server
47ENV OSMNBI_SOCKET_HOST 0.0.0.0
48ENV OSMNBI_SOCKET_PORT 9999
49# storage
50ENV OSMNBI_STORAGE_PATH /app/storage
51# database
52ENV OSMNBI_DATABASE_DRIVER mongo
53ENV OSMNBI_DATABASE_HOST mongo
54ENV OSMNBI_DATABASE_PORT 27017
55# web
56ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
57# logs
58ENV OSMNBI_LOG_FILE /app/log
59ENV OSMNBI_LOG_LEVEL DEBUG
60# message
61ENV OSMNBI_MESSAGE_DRIVER kafka
62ENV OSMNBI_MESSAGE_HOST kafka
63ENV OSMNBI_MESSAGE_PORT 9092
tiernof5298be2018-05-16 14:43:57 +020064# logs
65ENV OSMNBI_LOG_FILE /app/log/nbi.log
66ENV OSMNBI_LOG_LEVEL DEBUG
Mike Marchettic678d042018-04-18 13:51:27 -040067
68# Run app.py when the container launches
69CMD ["python3", "nbi.py"]
70