Add timeout_ns_update to the NS update params in valdation.py
[osm/NBI.git] / Dockerfile.local
1 ##
2 # Copyright ETSI
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License"); you may
5 # not use this file except in compliance with the License. You may obtain
6 # a copy of the License at
7 #
8 #         http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
12 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
13 # License for the specific language governing permissions and limitations
14 # under the License.
15 ##
16
17 ########################################################################
18
19 FROM ubuntu:18.04 as INSTALL
20
21 WORKDIR /build
22
23 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
24     DEBIAN_FRONTEND=noninteractive apt-get --yes install \
25     gcc git python3 python3-dev python3-venv python3-pip \
26     python3-setuptools wget && \
27     python3 -m pip install -U pip build
28
29 COPY . /build
30
31 RUN git clone https://osm.etsi.org/gerrit/osm/common.git
32 RUN git clone https://osm.etsi.org/gerrit/osm/IM.git
33
34 RUN python3 -m pip install \
35     -r requirements.txt \
36     -r common/requirements.txt \
37     -r IM/requirements.txt
38
39 RUN python3 -m build /build/common && \
40     python3 -m pip install /build/common/dist/*.whl
41
42 RUN python3 -m build /build/IM && \
43     python3 -m pip install /build/IM/dist/*.whl
44
45 RUN python3 -m build /build && \
46     python3 -m pip install /build/dist/*.whl
47
48
49 FROM ubuntu:18.04 as FINAL
50
51 RUN DEBIAN_FRONTEND=noninteractive apt-get --yes update && \
52     DEBIAN_FRONTEND=noninteractive apt-get --yes install python3-minimal
53
54 COPY --from=INSTALL /usr/lib/python3/dist-packages /usr/lib/python3/dist-packages
55 COPY --from=INSTALL /usr/local/lib/python3.6/dist-packages  /usr/local/lib/python3.6/dist-packages
56
57 RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
58
59 WORKDIR /app/osm_nbi
60
61 EXPOSE 9999
62
63 RUN cp -R /usr/local/lib/python3.6/dist-packages/osm_nbi/html_public /app/osm_nbi/html_public
64 RUN cp /usr/local/lib/python3.6/dist-packages/osm_nbi/nbi.cfg /app/osm_nbi/
65 RUN cp -R /usr/local/lib/python3.6/dist-packages/osm_nbi/http /app/osm_nbi/
66
67 # Used for local storage
68 VOLUME /app/storage
69 # Used for logs
70 VOLUME /app/log
71
72 # The following ENV can be added with "docker run -e xxx' to configure
73 # server
74 ENV OSMNBI_SOCKET_HOST     0.0.0.0
75 ENV OSMNBI_SOCKET_PORT     9999
76 ENV OSMNBI_SERVER_SSL_CERTIFICATE               /app/osm_nbi/http/cert.pem
77 ENV OSMNBI_SERVER_SSL_PRIVATE_KEY               /app/osm_nbi/http/privkey.pem
78
79 # storage
80 ENV OSMNBI_STORAGE_PATH    /app/storage
81
82 # database
83 ENV OSMNBI_DATABASE_DRIVER mongo
84 ENV OSMNBI_DATABASE_URI   mongodb://mongo:27017
85 #ENV OSMNBI_DATABASE_HOST   mongo
86 #ENV OSMNBI_DATABASE_PORT   27017
87
88 # web
89 ENV OSMNBI_STATIC_DIR      /app/osm_nbi/html_public
90
91 # message
92 ENV OSMNBI_MESSAGE_DRIVER  kafka
93 ENV OSMNBI_MESSAGE_HOST    kafka
94 ENV OSMNBI_MESSAGE_PORT    9092
95
96 # logs
97 ENV OSMNBI_LOG_FILE        /app/log/nbi.log
98 ENV OSMNBI_LOG_LEVEL       DEBUG
99
100 # authentication
101 ENV OSMNBI_AUTHENTICATION_BACKEND               internal
102 #ENV OSMNBI_AUTHENTICATION_BACKEND               keystone
103 #ENV OSMNBI_AUTHENTICATION_AUTH_URL              keystone
104 #ENV OSMNBI_AUTHENTICATION_AUTH_PORT             5000
105 #ENV OSMNBI_AUTHENTICATION_USER_DOMAIN_NAME      default
106 #ENV OSMNBI_AUTHENTICATION_PROJECT_DOMAIN_NAME   default
107 #ENV OSMNBI_AUTHENTICATION_SERVICE_USERNAME      nbi
108 #ENV OSMNBI_AUTHENTICATION_SERVICE_PASSWORD      nbi
109 #ENV OSMNBI_AUTHENTICATION_SERVICE_PROJECT       service
110
111 #prometheus
112 ENV OSMNBI_PROMETHEUS_HOST                      prometheus
113 ENV OSMNBI_PROMETHEUS_PORT                      9090
114
115 # Run app.py when the container launches
116 CMD ["python3", "-u", "-m", "osm_nbi.nbi"]