| Mike Marchetti | e6b9509 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 1 | # This creates osm/NBI docker from local NBI source code |
| 2 | |
| 3 | FROM ubuntu:16.04 |
| 4 | |
| 5 | RUN apt-get update && apt-get -y install curl software-properties-common |
| 6 | |
| 7 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| 8 | ARG RELEASE=ReleaseFOUR-daily |
| 9 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| 10 | ARG REPOSITORY=testing |
| 11 | |
| 12 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - |
| 13 | RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update |
| 14 | |
| 15 | RUN apt-get -y install python3-osm-nbi python3-osm-common python3-osm-im |
| 16 | |
| 17 | # Set the working directory to /app |
| 18 | WORKDIR /app/osm_nbi |
| 19 | |
| 20 | RUN 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 | |
| 26 | EXPOSE 9999 |
| 27 | |
| 28 | LABEL 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 |
| 34 | VOLUME /app/storage |
| 35 | # Used for logs |
| 36 | VOLUME /app/log |
| 37 | |
| 38 | # The following ENV can be added with "docker run -e xxx' to configure |
| 39 | # server |
| 40 | ENV OSMNBI_SOCKET_HOST 0.0.0.0 |
| 41 | ENV OSMNBI_SOCKET_PORT 9999 |
| 42 | # storage |
| 43 | ENV OSMNBI_STORAGE_PATH /app/storage |
| 44 | # database |
| 45 | ENV OSMNBI_DATABASE_DRIVER mongo |
| 46 | ENV OSMNBI_DATABASE_HOST mongo |
| 47 | ENV OSMNBI_DATABASE_PORT 27017 |
| 48 | # web |
| 49 | ENV OSMNBI_STATIC_DIR /usr/lib/python3/dist-packages/osm_nbi/html_public |
| 50 | # logs |
| 51 | ENV OSMNBI_LOG_FILE /app/log |
| 52 | ENV OSMNBI_LOG_LEVEL DEBUG |
| 53 | # message |
| 54 | ENV OSMNBI_MESSAGE_DRIVER kafka |
| 55 | ENV OSMNBI_MESSAGE_HOST kafka |
| 56 | ENV OSMNBI_MESSAGE_PORT 9092 |
| 57 | # logs |
| 58 | ENV OSMNBI_LOG_FILE /app/log/nbi.log |
| 59 | ENV OSMNBI_LOG_LEVEL DEBUG |
| 60 | |
| 61 | # Run app.py when the container launches |
| 62 | CMD ["python3", "/usr/lib/python3/dist-packages/osm_nbi/nbi.py"] |