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