Enable autocreation topic in kafka for POL and MON
[osm/devops.git] / installers / docker / docker-compose.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 ruok | nc -w 2 localhost 2181
44       interval: 20s
45       timeout: 10s
46       retries: 5
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       KAFKA_BROKER_ID: 1
64       KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://:9092
65       KAFKA_LISTENERS: PLAINTEXT://:9092
66       KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
67       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
68     volumes:
69       - /var/run/docker.sock:/var/run/docker.sock
70     healthcheck:
71       test: echo ruok | nc -w 2 zookeeper 2181
72       interval: 20s
73       timeout: 10s
74       retries: 5
75     logging:
76       driver: "json-file"
77       options:
78         max-size: "100m"
79         max-file: "2"
80     #depends_on:
81     #  - zookeeper
82   mongo:
83     image: mongo
84 #    ports:
85 #      - "27017:27017"
86     networks:
87       - netOSM
88     volumes:
89       - mongo_db:/data/db
90   prometheus:
91     image: prom/prometheus:${PROMETHEUS_TAG:-latest}
92     hostname: prometheus
93     ports:
94       - "${OSM_PROM_PORTS:-9091:9090}"
95     volumes:
96       - ./prometheus/:/etc/prometheus/
97       - prom_db:/prometheus
98     command:
99       - '--config.file=/etc/prometheus/prometheus.yml'
100       - '--web.enable-lifecycle'
101     networks:
102       - netOSM
103     logging:
104       driver: "json-file"
105       options:
106         max-size: "100m"
107         max-file: "2"
108   prometheus-cadvisor:
109     image: google/cadvisor:${PROMETHEUS_CADVISOR_TAG:-latest}
110     ports:
111       - "${OSM_PROM_CADVISOR_PORTS:-8080:8080}"
112     volumes:
113       - /:/rootfs:ro
114       - /var/run:/var/run:ro
115       - /sys:/sys:ro
116       - /var/lib/docker/:/var/lib/docker:ro
117       - /dev/disk/:/dev/disk:ro
118     networks:
119       - netOSM
120   keystone:
121     image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-7}
122     networks:
123       - netOSM
124     environment:
125       DB_HOST: mysql
126     env_file:
127       - ./keystone.env
128     ports:
129       - "${OSM_KEYSTONE_PORTS:-5000:5000}"
130     logging:
131       driver: "json-file"
132       options:
133         max-size: "100m"
134         max-file: "2"
135   nbi:
136     image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-7}
137     networks:
138       - netOSM
139     volumes:
140       - osm_packages:/app/storage
141     environment:
142       OSMNBI_DATABASE_HOST: mongo
143       OSMNBI_MESSAGE_HOST: kafka
144     env_file:
145       - ./nbi.env
146     ports:
147       - "${OSM_NBI_PORTS:-9999:9999}"
148     logging:
149       driver: "json-file"
150       options:
151         max-size: "100m"
152         max-file: "2"
153     #depends_on:
154     #  - kafka
155     #  - mongo
156   lcm:
157     image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-7}
158     networks:
159       - netOSM
160     volumes:
161       - osm_packages:/app/storage
162     environment:
163       OSMLCM_RO_HOST: ro
164       OSMLCM_DATABASE_HOST: mongo
165       OSMLCM_MESSAGE_HOST: kafka
166     env_file:
167       - ./lcm.env
168     logging:
169       driver: "json-file"
170       options:
171         max-size: "100m"
172         max-file: "2"
173     #depends_on:
174     #  - kafka
175     #  - mongo
176     #  - ro
177   mysql:
178     image: mysql:5
179     networks:
180       netOSM:
181         aliases:
182           - ro-db
183     volumes:
184       - ro_db:/var/lib/mysql
185     env_file:
186       - ./ro-db.env
187     logging:
188       driver: "json-file"
189       options:
190         max-size: "100m"
191         max-file: "2"
192 #    ports:
193 #      - "3306:3306"
194   ro:
195     image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-7}
196     networks:
197       - netOSM
198     environment:
199       RO_DB_HOST: mysql
200     env_file:
201       - ./ro.env
202     #depends_on:
203     #  - mysql
204     volumes:
205       - ro:/var/log/osm
206     ports:
207       - "${OSM_RO_PORTS:-9090:9090}"
208     logging:
209       driver: "json-file"
210       options:
211         max-size: "100m"
212         max-file: "2"
213   mon:
214     image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-7}
215     networks:
216       - netOSM
217     volumes:
218       - mon_db:/app/database
219     environment:
220       OSMMON_MESSAGE_HOST: kafka
221       OSMMON_MESSAGE_PORT: 9092
222     env_file:
223       - ./mon.env
224     ports:
225       - "${OSM_MON_PORTS:-8662:8662}"
226     #depends_on:
227     #  - kafka
228     logging:
229         driver: "json-file"
230         options:
231             max-file: 5
232             max-size: 10m
233   pol:
234     image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-7}
235     networks:
236       - netOSM
237     volumes:
238       - pol_db:/app/database
239     environment:
240       OSMPOL_MESSAGE_HOST: kafka
241       OSMPOL_MESSAGE_PORT: 9092
242     env_file:
243       - ./pol.env
244     #depends_on:
245     #  - kafka
246     #  - mon
247     logging:
248       driver: "json-file"
249       options:
250         max-file: 5
251         max-size: 10m
252   light-ui:
253     image: ${DOCKER_USER:-opensourcemano}/light-ui:${TAG:-7}
254     networks:
255       - netOSM
256     environment:
257       OSM_SERVER: nbi
258     #depends_on:
259     #  - nbi
260     env_file:
261       - ./lwui.env
262     ports:
263       - "${OSM_UI_PORTS:-80:80}"
264     logging:
265       driver: "json-file"
266       options:
267         max-size: "100m"
268         max-file: "2"
269   grafana:
270     image: grafana/grafana
271     volumes:
272       - ./grafana/dashboards-osm.yml:/etc/grafana/provisioning/dashboards/dashboards-osm.yml
273       - ./grafana/osm-sample-dashboard.json:/etc/grafana/provisioning/dashboards/osm-sample-dashboard.json
274       - ./grafana/osm-system-dashboard.json:/etc/grafana/provisioning/dashboards/osm-system-dashboard.json
275       - ./grafana/datasource-prometheus.yml:/etc/grafana/provisioning/datasources/datasource-prometheus.yml
276     hostname: grafana
277     ports:
278       - "${OSM_GRAFANA_PORTS:-3000:3000}"
279     networks:
280       - netOSM
281     logging:
282       driver: "json-file"
283       options:
284         max-size: "100m"
285         max-file: "2"
286