| tierno | d125caf | 2018-11-22 16:05:54 +0000 | [diff] [blame] | 1 | # 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 | |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 14 | # This creates osm/NBI docker from local NBI source code |
| 15 | |
| calvinosanch | 675b804 | 2020-01-09 16:10:12 +0100 | [diff] [blame^] | 16 | FROM ubuntu:18.04 |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 17 | |
| 18 | # Set the working directory to /app |
| tierno | 7bfe267 | 2019-08-30 15:12:47 +0000 | [diff] [blame] | 19 | WORKDIR /app/NBI |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 20 | |
| calvinosanch | 675b804 | 2020-01-09 16:10:12 +0100 | [diff] [blame^] | 21 | RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections |
| 22 | |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 23 | RUN apt-get update && apt-get install -y git python3 python3-jsonschema \ |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 24 | python3-pymongo python3-yaml python3-pip python3-keystoneclient \ |
| calvinosanch | 675b804 | 2020-01-09 16:10:12 +0100 | [diff] [blame^] | 25 | && python3 -m pip install pip --upgrade \ |
| 26 | && python3 -m pip install aiokafka aiohttp cherrypy==18.1.2 keystoneauth1 requests \ |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 27 | && mkdir -p /app/storage/kafka && mkdir -p /app/log |
| tierno | aae4dc4 | 2018-06-11 18:55:50 +0200 | [diff] [blame] | 28 | |
| 29 | # OSM_COMMON |
| tierno | 4c57e2e | 2018-11-16 22:59:35 +0100 | [diff] [blame] | 30 | RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \ |
| calvinosanch | 675b804 | 2020-01-09 16:10:12 +0100 | [diff] [blame^] | 31 | && python3 -m pip install -e /app/common |
| Eduardo Sousa | 56e698a | 2018-10-10 17:47:12 +0100 | [diff] [blame] | 32 | # && cd common && python3 setup.py develop && cd .. |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 33 | # && pip3 install -U -r requirements.txt \ |
| 34 | # && cd .. |
| 35 | |
| tierno | aae4dc4 | 2018-06-11 18:55:50 +0200 | [diff] [blame] | 36 | # OSM_IM |
| calvinosanch | 675b804 | 2020-01-09 16:10:12 +0100 | [diff] [blame^] | 37 | RUN git -C /app clone https://osm.etsi.org/gerrit/osm/IM \ |
| 38 | && python3 -m pip install /app/IM |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 39 | |
| 40 | EXPOSE 9999 |
| 41 | |
| 42 | LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \ |
| 43 | Description="This implements a north bound interface for OSM" \ |
| 44 | Version="1.0" \ |
| 45 | Author="Alfonso Tierno" |
| 46 | |
| 47 | # Used for local storage |
| 48 | VOLUME /app/storage |
| 49 | # Used for logs |
| 50 | VOLUME /app/log |
| 51 | |
| 52 | # The following ENV can be added with "docker run -e xxx' to configure |
| 53 | # server |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 54 | ENV OSMNBI_SOCKET_HOST 0.0.0.0 |
| 55 | ENV OSMNBI_SOCKET_PORT 9999 |
| tierno | 7bfe267 | 2019-08-30 15:12:47 +0000 | [diff] [blame] | 56 | ENV OSMNBI_SERVER_SSL_CERTIFICATE /app/NBI/osm_nbi/http/cert.pem |
| 57 | ENV OSMNBI_SERVER_SSL_PRIVATE_KEY /app/NBI/osm_nbi/http/privkey.pem |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 58 | # storage |
| Eduardo Sousa | 7e0eb13 | 2019-06-21 11:50:21 +0100 | [diff] [blame] | 59 | ENV OSMNBI_STORAGE_DRIVER local |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 60 | ENV OSMNBI_STORAGE_PATH /app/storage |
| Eduardo Sousa | 7e0eb13 | 2019-06-21 11:50:21 +0100 | [diff] [blame] | 61 | #ENV OSMNBI_STORAGE_DRIVER mongo |
| 62 | #ENV OSMNBI_STORAGE_URI mongodb://mongo:27017 |
| 63 | #ENV OSMNBI_STORAGE_COLLECTION files |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 64 | # database |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 65 | ENV OSMNBI_DATABASE_DRIVER mongo |
| 66 | ENV OSMNBI_DATABASE_HOST mongo |
| 67 | ENV OSMNBI_DATABASE_PORT 27017 |
| tierno | d985a8d | 2018-10-19 14:12:28 +0200 | [diff] [blame] | 68 | # ENV OSMNBI_DATABASE_USER xxx |
| 69 | # ENV OSMNBI_DATABASE_PASSWORD xxx |
| tierno | 92c1c7d | 2018-11-12 15:22:37 +0100 | [diff] [blame] | 70 | # ENV OSMNBI_DATABASE_COMMONKEY xxx |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 71 | # web |
| tierno | 4c57e2e | 2018-11-16 22:59:35 +0100 | [diff] [blame] | 72 | ENV OSMNBI_STATIC_DIR /app/NBI/osm_nbi/html_public |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 73 | # logs |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 74 | # ENV OSMNBI_LOG_FILE /app/log/nbi.log |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 75 | ENV OSMNBI_LOG_LEVEL DEBUG |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 76 | # message |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 77 | ENV OSMNBI_MESSAGE_DRIVER kafka |
| 78 | ENV OSMNBI_MESSAGE_HOST kafka |
| 79 | ENV OSMNBI_MESSAGE_PORT 9092 |
| Eduardo Sousa | 819d34c | 2018-07-31 01:20:02 +0100 | [diff] [blame] | 80 | # authentication |
| 81 | ENV OSMNBI_AUTHENTICATION_BACKEND internal |
| 82 | #ENV OSMNBI_AUTHENTICATION_BACKEND keystone |
| 83 | #ENV OSMNBI_AUTHENTICATION_AUTH_URL keystone |
| 84 | #ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000 |
| 85 | #ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default |
| 86 | #ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default |
| 87 | #ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi |
| 88 | #ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi |
| 89 | #ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service |
| Eduardo Sousa | 29933fc | 2018-11-14 06:36:35 +0000 | [diff] [blame] | 90 | # RBAC |
| 91 | ENV OSMNBI_RBAC_RESOURCES_TO_OPERATIONS /app/NBI/osm_nbi/resources_to_operations.yml |
| 92 | ENV OSMNBI_RBAC_ROLES_TO_OPERATIONS /app/NBI/osm_nbi/roles_to_operations.yml |
| vijay.r | 35ef2f7 | 2019-04-30 17:55:49 +0530 | [diff] [blame] | 93 | # prometheus |
| 94 | ENV OSMNBI_PROMETHEUS_HOST prometheus |
| 95 | ENV OSMNBI_PROMETHEUS_PORT 9090 |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 96 | |
| tierno | 4c57e2e | 2018-11-16 22:59:35 +0100 | [diff] [blame] | 97 | # Copy the current directory contents into the container at /app |
| Felipe Vicens | 07f3172 | 2018-10-29 15:16:44 +0100 | [diff] [blame] | 98 | ADD . /app/NBI |
| 99 | |
| Mike Marchetti | c678d04 | 2018-04-18 13:51:27 -0400 | [diff] [blame] | 100 | # Run app.py when the container launches |
| tierno | 7bfe267 | 2019-08-30 15:12:47 +0000 | [diff] [blame] | 101 | CMD python3 -m osm_nbi.nbi |
| 102 | |