blob: 0794a27ae1c2acbb9bd441269a2ebed37d617e7a [file] [log] [blame]
tiernod125caf2018-11-22 16:05:54 +00001# Licensed under the Apache License, Version 2.0 (the "License");
2# you may not use this file except in compliance with the License.
3# You may obtain a copy of the License at
4#
5# http://www.apache.org/licenses/LICENSE-2.0
6#
7# Unless required by applicable law or agreed to in writing, software
8# distributed under the License is distributed on an "AS IS" BASIS,
9# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
10# implied.
11# See the License for the specific language governing permissions and
12# limitations under the License.
13
tiernoa8d63632018-05-10 13:12:32 +020014# This creates osm/NBI docker from local NBI source code
15
calvinosanch675b8042020-01-09 16:10:12 +010016FROM ubuntu:18.04
Mike Marchettic678d042018-04-18 13:51:27 -040017
18# Set the working directory to /app
tierno7bfe2672019-08-30 15:12:47 +000019WORKDIR /app/NBI
Mike Marchettic678d042018-04-18 13:51:27 -040020
calvinosanch675b8042020-01-09 16:10:12 +010021RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
22
preethika.p329b8182020-04-22 12:25:39 +053023RUN apt-get update && apt-get install -y git python3 \
Eduardo Sousa819d34c2018-07-31 01:20:02 +010024 python3-pymongo python3-yaml python3-pip python3-keystoneclient \
calvinosanch675b8042020-01-09 16:10:12 +010025 && python3 -m pip install pip --upgrade \
fonsecajc3ee9cb2020-10-29 18:35:58 +000026 && python3 -m pip install aiokafka dataclasses aiohttp cherrypy==18.1.2 keystoneauth1 requests jsonschema==3.2.0 \
K Sai Kiran7ddb0732020-10-30 11:14:44 +053027 && python3 -m pip install tacacs_plus \
Mike Marchettic678d042018-04-18 13:51:27 -040028 && mkdir -p /app/storage/kafka && mkdir -p /app/log
tiernoaae4dc42018-06-11 18:55:50 +020029
30# OSM_COMMON
tierno4c57e2e2018-11-16 22:59:35 +010031RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \
calvinosanch675b8042020-01-09 16:10:12 +010032 && python3 -m pip install -e /app/common
Eduardo Sousa56e698a2018-10-10 17:47:12 +010033# && cd common && python3 setup.py develop && cd ..
tiernoa8d63632018-05-10 13:12:32 +020034# && pip3 install -U -r requirements.txt \
35# && cd ..
36
tiernoaae4dc42018-06-11 18:55:50 +020037# OSM_IM
calvinosanch675b8042020-01-09 16:10:12 +010038RUN git -C /app clone https://osm.etsi.org/gerrit/osm/IM \
39 && python3 -m pip install /app/IM
Mike Marchettic678d042018-04-18 13:51:27 -040040
41EXPOSE 9999
42
43LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
44 Description="This implements a north bound interface for OSM" \
45 Version="1.0" \
46 Author="Alfonso Tierno"
47
48# Used for local storage
49VOLUME /app/storage
50# Used for logs
51VOLUME /app/log
52
53# The following ENV can be added with "docker run -e xxx' to configure
54# server
Eduardo Sousa819d34c2018-07-31 01:20:02 +010055ENV OSMNBI_SOCKET_HOST 0.0.0.0
56ENV OSMNBI_SOCKET_PORT 9999
tierno7bfe2672019-08-30 15:12:47 +000057ENV OSMNBI_SERVER_SSL_CERTIFICATE /app/NBI/osm_nbi/http/cert.pem
58ENV OSMNBI_SERVER_SSL_PRIVATE_KEY /app/NBI/osm_nbi/http/privkey.pem
Mike Marchettic678d042018-04-18 13:51:27 -040059# storage
Eduardo Sousa7e0eb132019-06-21 11:50:21 +010060ENV OSMNBI_STORAGE_DRIVER local
Eduardo Sousa819d34c2018-07-31 01:20:02 +010061ENV OSMNBI_STORAGE_PATH /app/storage
Eduardo Sousa7e0eb132019-06-21 11:50:21 +010062#ENV OSMNBI_STORAGE_DRIVER mongo
63#ENV OSMNBI_STORAGE_URI mongodb://mongo:27017
64#ENV OSMNBI_STORAGE_COLLECTION files
Mike Marchettic678d042018-04-18 13:51:27 -040065# database
Eduardo Sousa819d34c2018-07-31 01:20:02 +010066ENV OSMNBI_DATABASE_DRIVER mongo
67ENV OSMNBI_DATABASE_HOST mongo
68ENV OSMNBI_DATABASE_PORT 27017
tiernod985a8d2018-10-19 14:12:28 +020069# ENV OSMNBI_DATABASE_USER xxx
70# ENV OSMNBI_DATABASE_PASSWORD xxx
tierno92c1c7d2018-11-12 15:22:37 +010071# ENV OSMNBI_DATABASE_COMMONKEY xxx
Mike Marchettic678d042018-04-18 13:51:27 -040072# web
tierno4c57e2e2018-11-16 22:59:35 +010073ENV OSMNBI_STATIC_DIR /app/NBI/osm_nbi/html_public
Mike Marchettic678d042018-04-18 13:51:27 -040074# logs
tierno0c01ffa2018-11-19 14:39:33 +010075# ENV OSMNBI_LOG_FILE /app/log/nbi.log
Eduardo Sousa819d34c2018-07-31 01:20:02 +010076ENV OSMNBI_LOG_LEVEL DEBUG
tierno4836bac2020-01-15 14:41:48 +000077# ENV OSMNBI_SERVER_ENABLE_TEST False
78
Mike Marchettic678d042018-04-18 13:51:27 -040079# message
Eduardo Sousa819d34c2018-07-31 01:20:02 +010080ENV OSMNBI_MESSAGE_DRIVER kafka
81ENV OSMNBI_MESSAGE_HOST kafka
82ENV OSMNBI_MESSAGE_PORT 9092
Eduardo Sousa819d34c2018-07-31 01:20:02 +010083# authentication
84ENV OSMNBI_AUTHENTICATION_BACKEND internal
85#ENV OSMNBI_AUTHENTICATION_BACKEND keystone
K Sai Kiran990ac462020-05-20 12:25:12 +053086#ENV OSMNBI_AUTHENTICATION_AUTH_URL http://keystone:5000/v3
Eduardo Sousa819d34c2018-07-31 01:20:02 +010087#ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000
tierno6486f742020-02-13 16:30:14 +000088
tiernoad6d5332020-02-19 14:29:49 +000089# DOMAIN_NAME can be a single value or a comma separated list of values. The first value is for internal domain
90# meanwhile the rest ones are external identity services as e.g. LDAP
91# for the case of USER_DOMAIN_NAME each item can be suffixed with ":ro" (read only). In this case NBI will reject any
92# operationi of create/update/delete users in this domain. Do not suffix PROJECT_DOMAIN_NAME
Eduardo Sousa819d34c2018-07-31 01:20:02 +010093#ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default
94#ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default
95#ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi
96#ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi
97#ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service
Eduardo Sousa29933fc2018-11-14 06:36:35 +000098# RBAC
99ENV OSMNBI_RBAC_RESOURCES_TO_OPERATIONS /app/NBI/osm_nbi/resources_to_operations.yml
100ENV OSMNBI_RBAC_ROLES_TO_OPERATIONS /app/NBI/osm_nbi/roles_to_operations.yml
vijay.r35ef2f72019-04-30 17:55:49 +0530101# prometheus
102ENV OSMNBI_PROMETHEUS_HOST prometheus
103ENV OSMNBI_PROMETHEUS_PORT 9090
Mike Marchettic678d042018-04-18 13:51:27 -0400104
tierno4c57e2e2018-11-16 22:59:35 +0100105# Copy the current directory contents into the container at /app
Felipe Vicens07f31722018-10-29 15:16:44 +0100106ADD . /app/NBI
107
Mike Marchettic678d042018-04-18 13:51:27 -0400108# Run app.py when the container launches
bravofb995ea22021-02-10 10:57:52 -0300109CMD ["python3", "-m", "osm_nbi.nbi"]
tierno7bfe2672019-08-30 15:12:47 +0000110