1 # Copyright 2018 Whitestack, LLC
2 # *************************************************************
4 # This file is part of OSM Monitoring module
5 # All Rights Reserved to Whitestack, LLC
7 # Licensed under the Apache License, Version 2.0 (the "License"); you may
8 # not use this file except in compliance with the License. You may obtain
9 # a copy of the License at
11 # http://www.apache.org/licenses/LICENSE-2.0
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
16 # License for the specific language governing permissions and limitations
19 # For those usages not covered by the Apache License, Version 2.0 please
20 # contact: bdiaz@whitestack.com or glavado@whitestack.com
25 LABEL authors="Benjamín Díaz"
27 RUN apt-get --yes update \
28 && apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
29 && apt-get --yes install mysql-client curl software-properties-common \
30 && pip3 install pip==9.0.3
32 ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
33 ARG RELEASE=ReleaseFOUR-daily
34 ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
35 ARG REPOSITORY=testing
37 RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
38 RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} POL common" && apt update
43 RUN apt-get --yes update && apt-get -y install python3-osm-policy-module${POL_VERSION}
45 COPY scripts/ scripts/
47 ENV OSMPOL_MESSAGE_DRIVER kafka
48 ENV OSMPOL_MESSAGE_HOST kafka
49 ENV OSMPOL_MESSAGE_PORT 9092
51 ENV OSMPOL_DATABASE_DRIVER mongo
52 ENV OSMPOL_DATABASE_URI mongodb://mongo:27017
54 ENV OSMPOL_SQL_DATABASE_URI sqlite:///mon_sqlite.db
56 ENV OSMPOL_GLOBAL_LOG_LEVEL INFO
58 HEALTHCHECK --interval=5s --timeout=2s --retries=12 \
59 CMD osm-pol-healthcheck || exit 1
61 CMD /bin/bash scripts/start.sh