blob: 7c4684f2d009df03e9fc835c19884b840fcf21e8 [file] [log] [blame]
tiernob3cda2e2018-10-30 17:26:59 +00001# Copyright 2018 Telefonica S.A.
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http://www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
12# implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15
tiernoc0e42e22018-05-11 11:36:10 +020016FROM ubuntu:16.04
17
18# Set the working directory to /app
tiernof7e0a642018-11-17 01:01:52 +010019WORKDIR /app/LCM/osm_lcm
tiernoc0e42e22018-05-11 11:36:10 +020020
tiernob3cda2e2018-10-30 17:26:59 +000021RUN apt-get update && apt-get install -y git tox python3 \
tierno2b611dd2019-01-11 10:30:57 +000022 python3-pip python3-aiohttp python3-jinja2 \
tiernoc0e42e22018-05-11 11:36:10 +020023 && pip3 install pip==9.0.3 \
tiernob3cda2e2018-10-30 17:26:59 +000024 && pip3 install -U 'PyYAML==3.*' 'aiohttp==0.20.2' flake8
tiernoc0e42e22018-05-11 11:36:10 +020025
tiernof7e0a642018-11-17 01:01:52 +010026RUN git -C /app clone https://osm.etsi.org/gerrit/osm/N2VC.git \
27 && pip3 install -e /app/N2VC \
28 && pip3 install -e /app/N2VC/modules/libjuju \
tiernof578e552018-11-08 19:07:20 +010029 && apt-get install -y libffi-dev libssl-dev openssh-client
tiernob3cda2e2018-10-30 17:26:59 +000030 # cd N2VC; python3 setup.py develop
31 # cd modules/libjuju; python3 setup.py develop
tiernoc0e42e22018-05-11 11:36:10 +020032
tiernof7e0a642018-11-17 01:01:52 +010033RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \
34 && pip3 install -e /app/common
tiernob3cda2e2018-10-30 17:26:59 +000035 # python3-pymongo python3-yaml pycrypto aiokafka
tiernoc0e42e22018-05-11 11:36:10 +020036
37RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
38
39
40LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
tierno8d950012018-05-22 12:27:48 +020041 Description="This implements the Life Cicle Management module of OSM" \
tiernoc0e42e22018-05-11 11:36:10 +020042 Version="1.0" \
43 Author="Alfonso Tierno"
44
45# Used for local storage
46VOLUME /app/storage
47# Used for logs
48VOLUME /app/log
49
50# The following ENV can be added with "docker run -e xxx' to configure LCM
51ENV OSMLCM_RO_HOST ro
52ENV OSMLCM_RO_PORT 9090
53ENV OSMLCM_RO_TENANT osm
54
55# VCA
56ENV OSMLCM_VCA_HOST vca
57ENV OSMLCM_VCA_PORT: 17070
58ENV OSMLCM_VCA_USER: admin
59ENV OSMLCM_VCA_SECRET: secret
60
61# database
62ENV OSMLCM_DATABASE_DRIVER mongo
tiernof7e0a642018-11-17 01:01:52 +010063ENV OSMLCM_DATABASE_URI mongodb://mongo:27017
64# ENV OSMLCM_DATABASE_COMMONKEY xxx
tierno17a612f2018-10-23 11:30:42 +020065# ENV OSMLCM_DATABASE_USER xxx
66# ENV OSMLCM_DATABASE_PASSWORD xxx
tierno17a612f2018-10-23 11:30:42 +020067
68#storage
tiernoc0e42e22018-05-11 11:36:10 +020069ENV OSMLCM_STORAGE_DRIVER local
70ENV OSMLCM_STORAGE_PATH /app/storage
71
72# message
73ENV OSMLCM_MESSAGE_DRIVER kafka
74ENV OSMLCM_MESSAGE_HOST kafka
75ENV OSMLCM_MESSAGE_PORT 9092
76
tierno275411e2018-05-16 14:33:32 +020077# logs
tiernof7e0a642018-11-17 01:01:52 +010078# ENV OSMLCM_GLOBAL_LOGFILE /app/log/lcm.log
tierno275411e2018-05-16 14:33:32 +020079ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG
80
tiernof7e0a642018-11-17 01:01:52 +010081# Copy the current directory contents into the container at /app/LCM
82ADD . /app/LCM
Felipe Vicensc2033f22018-11-15 15:09:58 +010083
tiernoc0e42e22018-05-11 11:36:10 +020084# Run app.py when the container launches
85CMD ["python3", "lcm.py"]
tiernoa9843d82018-10-24 10:44:20 +020086
tierno3e359b12019-02-03 02:29:13 +010087# HEALTHCHECK --interval=120s --timeout=15s --retries=1 \
tiernof7e0a642018-11-17 01:01:52 +010088# CMD python3 lcm.py --health-check || exit 1