blob: e5bdb864d9fde7badbac398d3b89b4bd1f6347bf [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
19WORKDIR /app/osm_lcm
20
21# Copy the current directory contents into the container at /app
Felipe Vicensc2033f22018-11-15 15:09:58 +010022#ADD . /app
tiernoc0e42e22018-05-11 11:36:10 +020023
tiernob3cda2e2018-10-30 17:26:59 +000024RUN apt-get update && apt-get install -y git tox python3 \
25 python3-pip python3-aiohttp \
tiernoc0e42e22018-05-11 11:36:10 +020026 && pip3 install pip==9.0.3 \
tiernob3cda2e2018-10-30 17:26:59 +000027 && pip3 install -U 'PyYAML==3.*' 'aiohttp==0.20.2' flake8
tiernoc0e42e22018-05-11 11:36:10 +020028
29RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
tiernob3cda2e2018-10-30 17:26:59 +000030 && pip3 install -e N2VC \
31 && pip3 install -e N2VC/modules/libjuju \
tiernof578e552018-11-08 19:07:20 +010032 && apt-get install -y libffi-dev libssl-dev openssh-client
tiernob3cda2e2018-10-30 17:26:59 +000033 # cd N2VC; python3 setup.py develop
34 # cd modules/libjuju; python3 setup.py develop
tiernoc0e42e22018-05-11 11:36:10 +020035
36RUN git clone https://osm.etsi.org/gerrit/osm/common.git \
tiernob3cda2e2018-10-30 17:26:59 +000037 && pip3 install -e common
38 # python3-pymongo python3-yaml pycrypto aiokafka
tiernoc0e42e22018-05-11 11:36:10 +020039
40RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
41
42
43LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
tierno8d950012018-05-22 12:27:48 +020044 Description="This implements the Life Cicle Management module of OSM" \
tiernoc0e42e22018-05-11 11:36:10 +020045 Version="1.0" \
46 Author="Alfonso Tierno"
47
48# Used for local storage
49VOLUME /app/storage
50# Used for logs
51VOLUME /app/log
52
53# The following ENV can be added with "docker run -e xxx' to configure LCM
54ENV OSMLCM_RO_HOST ro
55ENV OSMLCM_RO_PORT 9090
56ENV OSMLCM_RO_TENANT osm
57
58# VCA
59ENV OSMLCM_VCA_HOST vca
60ENV OSMLCM_VCA_PORT: 17070
61ENV OSMLCM_VCA_USER: admin
62ENV OSMLCM_VCA_SECRET: secret
63
64# database
65ENV OSMLCM_DATABASE_DRIVER mongo
66ENV OSMLCM_DATABASE_HOST mongo
67ENV OSMLCM_DATABASE_PORT 27017
tierno17a612f2018-10-23 11:30:42 +020068# ENV OSMLCM_DATABASE_USER xxx
69# ENV OSMLCM_DATABASE_PASSWORD xxx
tiernob6541cf2018-11-12 12:17:30 +010070# ENV OSMLCM_DATABASE_COMMONKEY xxx
tierno17a612f2018-10-23 11:30:42 +020071
72#storage
tiernoc0e42e22018-05-11 11:36:10 +020073ENV OSMLCM_STORAGE_DRIVER local
74ENV OSMLCM_STORAGE_PATH /app/storage
75
76# message
77ENV OSMLCM_MESSAGE_DRIVER kafka
78ENV OSMLCM_MESSAGE_HOST kafka
79ENV OSMLCM_MESSAGE_PORT 9092
80
tierno275411e2018-05-16 14:33:32 +020081# logs
82ENV OSMLCM_GLOBAL_LOGFILE /app/log/lcm.log
83ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG
84
Felipe Vicensc2033f22018-11-15 15:09:58 +010085ADD . /app
86
tiernoc0e42e22018-05-11 11:36:10 +020087# Run app.py when the container launches
88CMD ["python3", "lcm.py"]
tiernoa9843d82018-10-24 10:44:20 +020089
90# HEALTHCHECK --interval=30 --timeout=140 --retries=1 \
91# CMD python3 /usr/lib/python3/dist-packages/osm_lcm/lcm.py --health-check || exit 1
92