adding healthcheck by reading sent admin:ping from kafka
[osm/LCM.git] / Dockerfile.local
1 FROM ubuntu:16.04
2
3 # Set the working directory to /app
4 WORKDIR /app/osm_lcm
5
6 # Copy the current directory contents into the container at /app
7 ADD . /app
8
9 RUN apt-get update && apt-get install -y git python3 \
10     python3-pip python3-pymongo python3-yaml python3-aiohttp \
11     python3-stdeb python3-setuptools python3-all python-all \
12     python3-bitarray python3-regex python3-lxml debhelper dh-python tox wget \
13     python3-cffi \
14     && pip3 install pip==9.0.3 \
15     && pip3 install -U aiokafka pyang lxml six enum34
16
17 RUN git clone https://osm.etsi.org/gerrit/osm/N2VC.git \
18     && cd N2VC \
19     && git checkout BUILD_v4.0.1_1 \
20     && pip3 install websockets==4.0.1 \
21     && pip3 install requests \
22     && cd modules/libjuju && python3 setup.py develop && cd ../.. \
23     && pip3 install -U -r requirements.txt \
24     && python3 setup.py develop \
25     && cd ..
26
27 RUN git clone https://osm.etsi.org/gerrit/osm/common.git \
28     && cd common  && python3 setup.py develop && cd ..
29 #    && pip3 install -U -r requirements.txt \
30 #    && cd ..
31
32 RUN mkdir -p /app/storage/kafka && mkdir -p /app/log
33
34
35 LABEL Maintainer="alfonso.tiernosepulveda@telefonica.com" \
36       Description="This implements the Life Cicle Management module of OSM" \
37       Version="1.0" \
38       Author="Alfonso Tierno"
39
40 # Used for local storage
41 VOLUME /app/storage
42 # Used for logs
43 VOLUME /app/log
44
45 # The following ENV can be added with "docker run -e xxx' to configure LCM
46 ENV OSMLCM_RO_HOST         ro
47 ENV OSMLCM_RO_PORT         9090
48 ENV OSMLCM_RO_TENANT       osm
49
50 # VCA
51 ENV OSMLCM_VCA_HOST        vca
52 ENV OSMLCM_VCA_PORT:       17070
53 ENV OSMLCM_VCA_USER:       admin
54 ENV OSMLCM_VCA_SECRET:     secret
55
56 # database
57 ENV OSMLCM_DATABASE_DRIVER mongo
58 ENV OSMLCM_DATABASE_HOST   mongo
59 ENV OSMLCM_DATABASE_PORT   27017
60 ENV OSMLCM_STORAGE_DRIVER  local
61 ENV OSMLCM_STORAGE_PATH    /app/storage
62
63 # message
64 ENV OSMLCM_MESSAGE_DRIVER  kafka
65 ENV OSMLCM_MESSAGE_HOST    kafka
66 ENV OSMLCM_MESSAGE_PORT    9092
67
68 # logs
69 ENV OSMLCM_GLOBAL_LOGFILE  /app/log/lcm.log
70 ENV OSMLCM_GLOBAL_LOGLEVEL DEBUG
71
72 # Run app.py when the container launches
73 CMD ["python3", "lcm.py"]
74
75 # HEALTHCHECK --interval=30 --timeout=140 --retries=1 \
76 #     CMD python3 /usr/lib/python3/dist-packages/osm_lcm/lcm.py --health-check || exit 1
77