blob: 44b24b2404b68d7c587bbb3099ebb6dcef536e4c [file] [log] [blame]
Mike Marchettie6b95092018-09-05 09:52:42 -04001# This creates osm/NBI docker from local NBI source code
2
3FROM ubuntu:16.04
4
5RUN apt-get update && apt-get -y install curl software-properties-common
6
7ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
8ARG RELEASE=ReleaseFOUR-daily
9ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
10ARG REPOSITORY=testing
11
12RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
13RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update
14
15RUN apt-get -y install python3-osm-nbi python3-osm-common python3-osm-im
16
17# Set the working directory to /app
18WORKDIR /app/osm_nbi
19
20RUN apt-get update && apt-get install -y git python3 python3-jsonschema \
21 python3-pymongo python3-yaml python3-pip \
22 && pip3 install pip==9.0.3 \
23 && pip3 install aiokafka cherrypy pyangbind \
24 && mkdir -p /app/storage/kafka && mkdir -p /app/log
25
26EXPOSE 9999
27
28LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
29 Description="This implements a north bound interface for OSM" \
30 Version="1.0" \
31 Author="Alfonso Tierno"
32
33# Used for local storage
34VOLUME /app/storage
35# Used for logs
36VOLUME /app/log
37
38# The following ENV can be added with "docker run -e xxx' to configure
39# server
40ENV OSMNBI_SOCKET_HOST 0.0.0.0
41ENV OSMNBI_SOCKET_PORT 9999
42# storage
43ENV OSMNBI_STORAGE_PATH /app/storage
44# database
45ENV OSMNBI_DATABASE_DRIVER mongo
46ENV OSMNBI_DATABASE_HOST mongo
47ENV OSMNBI_DATABASE_PORT 27017
48# web
49ENV OSMNBI_STATIC_DIR /usr/lib/python3/dist-packages/osm_nbi/html_public
50# logs
51ENV OSMNBI_LOG_FILE /app/log
52ENV OSMNBI_LOG_LEVEL DEBUG
53# message
54ENV OSMNBI_MESSAGE_DRIVER kafka
55ENV OSMNBI_MESSAGE_HOST kafka
56ENV OSMNBI_MESSAGE_PORT 9092
57# logs
58ENV OSMNBI_LOG_FILE /app/log/nbi.log
59ENV OSMNBI_LOG_LEVEL DEBUG
60
61# Run app.py when the container launches
62CMD ["python3", "/usr/lib/python3/dist-packages/osm_nbi/nbi.py"]