Feature 8839: Modified Installation script to install OSM with
[osm/devops.git] / installers / docker / docker-compose-ngui.yaml
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
19 version: '3'
20 volumes:
21   ro:
22   ro_db:
23   mongo_db:
24   mon_db:
25   pol_db:
26   osm_packages:
27   prom_db:
28 networks:
29   netOSM:
30     external:
31       name: ${OSM_NETWORK:-netosm}
32     #driver: overlay
33     #driver_opts:
34     #  com.docker.network.driver.mtu: "1446"
35 services:
36   zookeeper:
37     image: wurstmeister/zookeeper:${ZOOKEEPER_TAG:-latest}
38 #    ports:
39 #      - "2181:2181"
40     networks:
41       - netOSM
42     healthcheck:
43       test: echo stat | nc localhost 2181
44       interval: 10s
45       timeout: 10s
46       retries: 3
47     logging:
48       driver: "json-file"
49       options:
50         max-size: "100m"
51         max-file: "2"
52   kafka:
53     image: wurstmeister/kafka:${KAFKA_TAG:-latest}
54     ports:
55       - "9092"
56     networks:
57       - netOSM
58     environment:
59       KAFKA_ADVERTISED_HOST_NAME: kafka
60       KAFKA_ADVERTISED_PORT: 9092
61       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
62       KAFKA_LOG_RETENTION_HOURS: 24
63     volumes:
64       - /var/run/docker.sock:/var/run/docker.sock
65     healthcheck:
66       test: zookeeper-shell.sh zookeeper:2181 ls /brokers/ids 2>&1 | grep "Node does not exist" && exit 1 || exit 0
67       interval: 20s
68       timeout: 10s
69       retries: 5
70     logging:
71       driver: "json-file"
72       options:
73         max-size: "100m"
74         max-file: "2"
75     #depends_on:
76     #  - zookeeper
77   mongo:
78     image: mongo
79 #    ports:
80 #      - "27017:27017"
81     networks:
82       - netOSM
83     volumes:
84       - mongo_db:/data/db
85   prometheus:
86     image: prom/prometheus:${PROMETHEUS_TAG:-latest}
87     hostname: prometheus
88     ports:
89       - "${OSM_PROM_PORTS:-9091:9090}"
90     volumes:
91       - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
92       - prom_db:/prometheus
93     networks:
94       - netOSM
95     logging:
96       driver: "json-file"
97       options:
98         max-size: "100m"
99         max-file: "2"
100   prometheus-cadvisor:
101     image: google/cadvisor:${PROMETHEUS_CADVISOR_TAG:-latest}
102     ports:
103       - "${OSM_PROM_CADVISOR_PORTS:-8080:8080}"
104     volumes:
105       - /:/rootfs:ro
106       - /var/run:/var/run:ro
107       - /sys:/sys:ro
108       - /var/lib/docker/:/var/lib/docker:ro
109       - /dev/disk/:/dev/disk:ro
110     networks:
111       - netOSM
112   keystone:
113     image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-7}
114     networks:
115       - netOSM
116     environment:
117       DB_HOST: mysql
118     env_file:
119       - ./keystone.env
120     ports:
121       - "${OSM_KEYSTONE_PORTS:-5000:5000}"
122     logging:
123       driver: "json-file"
124       options:
125         max-size: "100m"
126         max-file: "2"
127   nbi:
128     image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-7}
129     networks:
130       - netOSM
131     volumes:
132       - osm_packages:/app/storage
133     environment:
134       OSMNBI_DATABASE_HOST: mongo
135       OSMNBI_MESSAGE_HOST: kafka
136     env_file:
137       - ./nbi.env
138     ports:
139       - "${OSM_NBI_PORTS:-9999:9999}"
140     logging:
141       driver: "json-file"
142       options:
143         max-size: "100m"
144         max-file: "2"
145     #depends_on:
146     #  - kafka
147     #  - mongo
148   lcm:
149     image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-7}
150     networks:
151       - netOSM
152     volumes:
153       - osm_packages:/app/storage
154     environment:
155       OSMLCM_RO_HOST: ro
156       OSMLCM_DATABASE_HOST: mongo
157       OSMLCM_MESSAGE_HOST: kafka
158     env_file:
159       - ./lcm.env
160     logging:
161       driver: "json-file"
162       options:
163         max-size: "100m"
164         max-file: "2"
165     #depends_on:
166     #  - kafka
167     #  - mongo
168     #  - ro
169   mysql:
170     image: mysql:5
171     networks:
172       netOSM:
173         aliases:
174           - ro-db
175     volumes:
176       - ro_db:/var/lib/mysql
177     env_file:
178       - ./ro-db.env
179     logging:
180       driver: "json-file"
181       options:
182         max-size: "100m"
183         max-file: "2"
184 #    ports:
185 #      - "3306:3306"
186   ro:
187     image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-7}
188     networks:
189       - netOSM
190     environment:
191       RO_DB_HOST: mysql
192     env_file:
193       - ./ro.env
194     #depends_on:
195     #  - mysql
196     volumes:
197       - ro:/var/log/osm
198     ports:
199       - "${OSM_RO_PORTS:-9090:9090}"
200     logging:
201       driver: "json-file"
202       options:
203         max-size: "100m"
204         max-file: "2"
205   mon:
206     image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-7}
207     networks:
208       - netOSM
209     volumes:
210       - mon_db:/app/database
211     environment:
212       OSMMON_MESSAGE_HOST: kafka
213       OSMMON_MESSAGE_PORT: 9092
214     env_file:
215       - ./mon.env
216     ports:
217       - "${OSM_MON_PORTS:-8662:8662}"
218     #depends_on:
219     #  - kafka
220     logging:
221         driver: "json-file"
222         options:
223             max-file: 5
224             max-size: 10m
225   pol:
226     image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-7}
227     networks:
228       - netOSM
229     volumes:
230       - pol_db:/app/database
231     environment:
232       OSMPOL_MESSAGE_HOST: kafka
233       OSMPOL_MESSAGE_PORT: 9092
234     env_file:
235       - ./pol.env
236     #depends_on:
237     #  - kafka
238     #  - mon
239     logging:
240       driver: "json-file"
241       options:
242         max-file: 5
243         max-size: 10m
244   ng-ui:
245     image: ${DOCKER_USER:-opensourcemano}/ng-ui:${TAG:-7}
246     networks:
247       - netOSM
248     #depends_on:
249     #  - nbi
250     ports:
251       - "${OSM_UI_PORTS:-80:80}"
252     logging:
253       driver: "json-file"
254       options:
255         max-size: "100m"
256         max-file: "2"
257   grafana:
258     image: grafana/grafana
259     volumes:
260       - ./files/dashboards-osm.yml:/etc/grafana/provisioning/dashboards/dashboards-osm.yml
261       - ./files/osm-sample-dashboard.json:/etc/grafana/provisioning/dashboards/osm-sample-dashboard.json
262       - ./files/osm-system-dashboard.json:/etc/grafana/provisioning/dashboards/osm-system-dashboard.json
263       - ./files/datasource-prometheus.yml:/etc/grafana/provisioning/datasources/datasource-prometheus.yml
264     hostname: grafana
265     ports:
266       - "${OSM_GRAFANA_PORTS:-3000:3000}"
267     networks:
268       - netOSM
269     logging:
270       driver: "json-file"
271       options:
272         max-size: "100m"
273         max-file: "2"
274