| calvinosanch | bfb7790 | 2019-07-31 13:31:16 +0000 | [diff] [blame^] | 1 | ## |
| 2 | # Copyright 2019 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 | |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 19 | from ubuntu:xenial |
| 20 | |
| 21 | MAINTAINER Gennadiy Dubina <gennadiy.dubina@dataat.com>; Alfonso Tierno <alfonso.tiernosepulveda@telefoncia.com> |
| 22 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 23 | RUN apt-get update && apt-get -y install curl software-properties-common git |
| garciadeblas | 05e89d3 | 2018-11-29 15:49:03 +0100 | [diff] [blame] | 24 | RUN DEBIAN_FRONTEND=noninteractive add-apt-repository -y cloud-archive:queens |
| garciadeblas | 6c99145 | 2018-10-28 23:44:43 +0100 | [diff] [blame] | 25 | RUN apt-get update && apt-get install -y python-setuptools python-wheel mysql-client python-bitarray python-pip |
| calvinosanch | bfb7790 | 2019-07-31 13:31:16 +0000 | [diff] [blame^] | 26 | RUN DEBIAN_FRONTEND=noninteractive pip2 install -U pip && python -m pip install pyangbind |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 27 | |
| 28 | ARG REPOSITORY_BASE=http://osm-download.etsi.org/repository/osm/debian |
| 29 | ARG RELEASE=ReleaseFOUR-daily |
| 30 | ARG REPOSITORY_KEY=OSM%20ETSI%20Release%20Key.gpg |
| 31 | ARG REPOSITORY=testing |
| 32 | |
| 33 | RUN curl ${REPOSITORY_BASE}/${RELEASE}/${REPOSITORY_KEY} | apt-key add - |
| 34 | RUN add-apt-repository -y "deb ${REPOSITORY_BASE}/${RELEASE} ${REPOSITORY} RO IM common openvim" && apt update |
| 35 | |
| Mike Marchetti | 13d76c8 | 2018-09-19 15:00:36 -0400 | [diff] [blame] | 36 | ARG RO_VERSION |
| 37 | ARG IM_VERSION |
| 38 | |
| 39 | RUN apt-get update && apt-get install -y python-osm-ro${RO_VERSION} python-osm-im${IM_VERSION} |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 40 | |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 41 | |
| garciadeblas | e3697a1 | 2018-12-10 15:49:27 +0100 | [diff] [blame] | 42 | VOLUME /var/log/osm |
| Mike Marchetti | 182bd73 | 2018-09-05 09:52:42 -0400 | [diff] [blame] | 43 | |
| 44 | EXPOSE 9090 |
| 45 | |
| 46 | # Two mysql databases are needed (DB and DB_OVIM). Can be hosted on same or separated containers |
| 47 | # These ENV must be provided |
| 48 | ENV RO_DB_HOST="" |
| 49 | ENV RO_DB_OVIM_HOST="" |
| 50 | # if empty RO_DB_HOST is assumed |
| 51 | |
| 52 | # These ENV should be provided first time for creating database. It will create and init only if empty! |
| 53 | ENV RO_DB_ROOT_PASSWORD="" |
| 54 | ENV RO_DB_OVIM_ROOT_PASSWORD="" |
| 55 | # if empty RO_DB_ROOT_PASSWORD is assumed |
| 56 | |
| 57 | # These ENV can be provided, but default values are ok |
| 58 | ENV RO_DB_USER=mano |
| 59 | ENV RO_DB_OVIM_USER=mano |
| 60 | ENV RO_DB_PASSWORD=manopw |
| 61 | ENV RO_DB_OVIM_PASSWORD=manopw |
| 62 | ENV RO_DB_PORT=3306 |
| 63 | ENV RO_DB_OVIM_PORT=3306 |
| 64 | ENV RO_DB_NAME=mano_db |
| 65 | ENV RO_DB_OVIM_NAME=mano_vim_db |
| 66 | |
| tierno | 551c894 | 2019-02-07 14:42:14 +0100 | [diff] [blame] | 67 | HEALTHCHECK --start-period=130s --interval=10s --timeout=5s --retries=12 \ |
| Mike Marchetti | 851aac2 | 2018-09-20 10:18:01 -0400 | [diff] [blame] | 68 | CMD curl --silent --fail localhost:9090/openmano/tenants || exit 1 |
| tierno | 1ab62ca | 2019-06-19 15:30:16 +0000 | [diff] [blame] | 69 | CMD /usr/bin/RO-start.sh |
| 70 | |