blob: 120630ab7bbc5b20680209f3cfa6029b4fee4b64 [file] [log] [blame]
tiernoa8d63632018-05-10 13:12:32 +02001# This creates som/NBI docker from from last stable package
2
3FROM ubuntu:16.04
4
tierno0c01ffa2018-11-19 14:39:33 +01005ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
6ARG RELEASE=ReleaseFIVE
7ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
8ARG REPOSITORY=testing
9
10RUN apt-get update && apt-get install -y curl software-properties-common
11RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
12RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} NBI IM common" && apt update
13
14RUN apt-get -y install python3-osm-nbi
15
tiernoa8d63632018-05-10 13:12:32 +020016# Set the working directory to /app
17WORKDIR /app/osm_nbi
18
tierno0c01ffa2018-11-19 14:39:33 +010019RUN cp -R /usr/lib/python3/dist-packages/osm_nbi/html_public /app/osm_nbi/html_public \
20 && cp /usr/lib/python3/dist-packages/osm_nbi/nbi.cfg /app/osm_nbi/ \
21 && cp -R /usr/lib/python3/dist-packages/osm_nbi/http /app/osm_nbi/
tiernoa8d63632018-05-10 13:12:32 +020022
23EXPOSE 9999
24
25LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
26 Description="This implements a north bound interface for OSM" \
27 Version="1.0" \
28 Author="Alfonso Tierno"
29
30# Used for local storage
31VOLUME /app/storage
32# Used for logs
33VOLUME /app/log
34
35# The following ENV can be added with "docker run -e xxx' to configure
36# server
37ENV OSMNBI_SOCKET_HOST 0.0.0.0
38ENV OSMNBI_SOCKET_PORT 9999
39# storage
40ENV OSMNBI_STORAGE_PATH /app/storage
41# database
42ENV OSMNBI_DATABASE_DRIVER mongo
tierno0c01ffa2018-11-19 14:39:33 +010043ENV OSMNBI_DATABASE_URI mongodb://mongo:27017
tiernoa8d63632018-05-10 13:12:32 +020044# web
45ENV OSMNBI_STATIC_DIR /app/osm_nbi/html_public
46# logs
tierno0c01ffa2018-11-19 14:39:33 +010047# ENV OSMNBI_LOG_FILE /app/log
tiernoa8d63632018-05-10 13:12:32 +020048ENV OSMNBI_LOG_LEVEL DEBUG
49# message
50ENV OSMNBI_MESSAGE_DRIVER kafka
51ENV OSMNBI_MESSAGE_HOST kafka
52ENV OSMNBI_MESSAGE_PORT 9092
tierno0c01ffa2018-11-19 14:39:33 +010053# authentication
54ENV OSMNBI_AUTHENTICATION_BACKEND internal
55#ENV OSMNBI_AUTHENTICATION_BACKEND keystone
56#ENV OSMNBI_AUTHENTICATION_AUTH_URL keystone
57#ENV OSMNBI_AUTHENTICATION_AUTH_PORT 5000
58#ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME default
59#ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME default
60#ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME nbi
61#ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD nbi
62#ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT service
tiernoa8d63632018-05-10 13:12:32 +020063
64# Run app.py when the container launches
tierno0c01ffa2018-11-19 14:39:33 +010065CMD ["python3", "/usr/lib/python3/dist-packages/osm_nbi/nbi.py"]
66
67HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
68 CMD curl -k https://localhost:9999/osm/ | grep Welcome || exit 1
tiernoa8d63632018-05-10 13:12:32 +020069