blob: 2dd1382b23b6802727b61be66158542224167067 [file] [log] [blame]
Mike Marchetti13d76c82018-09-19 15:00:36 -04001# Copyright 2018 Whitestack, LLC
2# *************************************************************
3
4# This file is part of OSM Monitoring module
5# All Rights Reserved to Whitestack, LLC
6
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
10
11# http://www.apache.org/licenses/LICENSE-2.0
12
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
17# under the License.
18
19# For those usages not covered by the Apache License, Version 2.0 please
20# contact: bdiaz@whitestack.com or glavado@whitestack.com
21##
22
23FROM ubuntu:16.04
24
25LABEL authors="Benjamín Díaz"
26
27RUN apt-get --yes update \
Mike Marchettidc8ea9c2018-09-21 11:36:05 -040028 && apt-get --yes install git python python-pip python3 python3-pip libmysqlclient-dev libssl-dev libffi-dev \
Benjamin Diaz8e003842019-05-21 12:29:23 -030029 && apt-get --yes install mysql-client curl software-properties-common \
Mike Marchettidc8ea9c2018-09-21 11:36:05 -040030 && pip3 install pip==9.0.3
Mike Marchetti13d76c82018-09-19 15:00:36 -040031
Mike Marchettidc8ea9c2018-09-21 11:36:05 -040032ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian
33ARG RELEASE=ReleaseFOUR-daily
34ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg
35ARG REPOSITORY=testing
Mike Marchetti13d76c82018-09-19 15:00:36 -040036
Mike Marchettidc8ea9c2018-09-21 11:36:05 -040037RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add -
38RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} POL common" && apt update
39
40ARG POL_VERSION
41ARG COMMON_VERSION
42
43RUN apt-get --yes update && apt-get -y install python3-osm-policy-module${POL_VERSION}
44
Benjamin Diaz04560882019-02-26 17:25:07 -030045COPY scripts/ scripts/
46
Eduardo Sousa280ccc72018-09-21 16:34:29 +010047ENV OSMPOL_MESSAGE_DRIVER kafka
48ENV OSMPOL_MESSAGE_HOST kafka
49ENV OSMPOL_MESSAGE_PORT 9092
50
51ENV OSMPOL_DATABASE_DRIVER mongo
Juancc084d72018-11-16 11:08:07 -030052ENV OSMPOL_DATABASE_URI mongodb://mongo:27017
Eduardo Sousa280ccc72018-09-21 16:34:29 +010053
54ENV OSMPOL_SQL_DATABASE_URI sqlite:///mon_sqlite.db
55
Benjamin Diaze6f7b452019-02-07 12:09:57 -030056ENV OSMPOL_GLOBAL_LOG_LEVEL INFO
Eduardo Sousa280ccc72018-09-21 16:34:29 +010057
tierno836e9db2019-07-22 13:23:56 +000058HEALTHCHECK --start-period=120s --interval=10s --timeout=5s --retries=5 \
Benjamin Diazdeb99f32019-05-27 17:01:06 -030059 CMD osm-pol-healthcheck || exit 1
60
Benjamin Diaz04560882019-02-26 17:25:07 -030061CMD /bin/bash scripts/start.sh