| 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 | 533f64d | 2018-11-28 10:18:41 +0000 | [diff] [blame] | 14 | # This creates osm/NBI docker from from last stable package |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 15 | |
| 16 | FROM ubuntu:16.04 |
| 17 | |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 18 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| 19 | ARG RELEASE=ReleaseFIVE |
| 20 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| Philippe Coval | 9fe58b1 | 2019-10-30 14:42:36 +0100 | [diff] [blame] | 21 | ARG REPOSITORY=stable |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 22 | |
| 23 | RUN apt-get update && apt-get install -y curl software-properties-common |
| 24 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - |
| 25 | RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update |
| 26 | |
| 27 | RUN apt-get -y install python3-osm-nbi |
| 28 | |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 29 | # Set the working directory to /app |
| 30 | WORKDIR /app/osm_nbi |
| 31 | |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 32 | RUN cp -R /usr/lib/python3/dist-packages/osm_nbi/html_public /app/osm_nbi/html_public \ |
| 33 | && cp /usr/lib/python3/dist-packages/osm_nbi/nbi.cfg /app/osm_nbi/ \ |
| 34 | && cp -R /usr/lib/python3/dist-packages/osm_nbi/http /app/osm_nbi/ |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 35 | |
| 36 | EXPOSE 9999 |
| 37 | |
| 38 | LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \ |
| 39 | Description="This implements a north bound interface for OSM" \ |
| 40 | Version="1.0" \ |
| 41 | Author="Alfonso Tierno" |
| 42 | |
| 43 | # Used for local storage |
| 44 | VOLUME /app/storage |
| 45 | # Used for logs |
| 46 | VOLUME /app/log |
| 47 | |
| 48 | # The following ENV can be added with "docker run -e xxx' to configure |
| 49 | # server |
| 50 | ENV OSMNBI_SOCKET_HOST 0.0.0.0 |
| 51 | ENV OSMNBI_SOCKET_PORT 9999 |
| 52 | # storage |
| 53 | ENV OSMNBI_STORAGE_PATH /app/storage |
| 54 | # database |
| 55 | ENV OSMNBI_DATABASE_DRIVER mongo |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 56 | ENV OSMNBI_DATABASE_URI mongodb://mongo:27017 |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 57 | # web |
| 58 | ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public |
| 59 | # logs |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 60 | # ENV OSMNBI_LOG_FILE /app/log |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 61 | ENV OSMNBI_LOG_LEVEL DEBUG |
| 62 | # message |
| 63 | ENV OSMNBI_MESSAGE_DRIVER kafka |
| 64 | ENV OSMNBI_MESSAGE_HOST kafka |
| 65 | ENV OSMNBI_MESSAGE_PORT 9092 |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 66 | # authentication |
| 67 | ENV OSMNBI_AUTHENTICATION_BACKEND internal |
| 68 | #ENV OSMNBI_AUTHENTICATION_BACKEND keystone |
| K Sai Kiran | 990ac46 | 2020-05-20 12:25:12 +0530 | [diff] [blame] | 69 | #ENV OSMNBI_AUTHENTICATION_AUTH_URL http://keystone:5000/v3 |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 70 | #ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000 |
| 71 | #ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default |
| 72 | #ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default |
| 73 | #ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi |
| 74 | #ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi |
| 75 | #ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 76 | |
| 77 | # Run app.py when the container launches |
| tierno | 0c01ffa | 2018-11-19 14:39:33 +0100 | [diff] [blame] | 78 | CMD ["python3", "/usr/lib/python3/dist-packages/osm_nbi/nbi.py"] |
| 79 | |
| 80 | HEALTHCHECK --interval=5s --timeout=2s --retries=12 \ |
| 81 | CMD curl -k https://localhost:9999/osm/ | grep Welcome || exit 1 |
| tierno | a8d6363 | 2018-05-10 13:12:32 +0200 | [diff] [blame] | 82 | |