1 # Copyright 2018 Telefonica S.A.
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
7 # http://www.apache.org/licenses/LICENSE-2.0
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
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
18 # Set the working directory to /app
19 WORKDIR /app/LCM/osm_lcm
21 RUN apt-get update && apt-get install -y git tox python3 \
22 python3-pip python3-aiohttp python3-jinja2 \
23 && pip3 install pip==9.0.3 \
24 && pip3 install -U 'PyYAML==3.*' 'aiohttp==0.20.2' flake8
26 RUN 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 \
29 && apt-get install -y libffi-dev libssl-dev openssh-client
30 # cd N2VC; python3 setup.py develop
31 # cd modules/libjuju; python3 setup.py develop
33 RUN git -C /app clone https://osm.etsi.org/gerrit/osm/common.git \
34 && pip3 install -e /app/common
35 # python3-pymongo python3-yaml pycrypto aiokafka
37 RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
40 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
41 Description="This implements the Life Cicle Management module of OSM" \
43 Author="Alfonso Tierno"
45 # Used for local storage
50 # The following ENV can be added with "docker run -e xxx' to configure LCM
52 ENV OSMLCM_RO_PORT 9090
53 ENV OSMLCM_RO_TENANT osm
56 ENV OSMLCM_VCA_HOST vca
57 ENV OSMLCM_VCA_PORT: 17070
58 ENV OSMLCM_VCA_USER: admin
59 ENV OSMLCM_VCA_SECRET: secret
60 # ENV OSMLCM_VCA_PUBKEY: pubkey
61 # ENV OSMLCM_VCA_CACERT: cacert
64 ENV OSMLCM_DATABASE_DRIVER mongo
65 ENV OSMLCM_DATABASE_URI mongodb://mongo:27017
66 # ENV OSMLCM_DATABASE_COMMONKEY xxx
67 # ENV OSMLCM_DATABASE_USER xxx
68 # ENV OSMLCM_DATABASE_PASSWORD xxx
71 ENV OSMLCM_STORAGE_DRIVER local
72 ENV OSMLCM_STORAGE_PATH /app/storage
75 ENV OSMLCM_MESSAGE_DRIVER kafka
76 ENV OSMLCM_MESSAGE_HOST kafka
77 ENV OSMLCM_MESSAGE_PORT 9092
80 # ENV OSMLCM_GLOBAL_LOGFILE /app/log/lcm.log
81 ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG
83 # Copy the current directory contents into the container at /app/LCM
86 # Run app.py when the container launches
87 CMD ["python3", "lcm.py"]
89 # HEALTHCHECK --interval=120s --timeout=15s --retries=1 \
90 # CMD python3 lcm.py --health-check || exit 1