Fix installation to use 9 tag as default for docker images
[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:-9}
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:-9}
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:-9}
158     networks:
159       - netOSM
160     volumes:
161       - osm_packages:/app/storage
162     environment:
163       OSMLCM_RO_HOST: ro
164       OSMLCM_RO_PORT: "9090"
165       OSMLCM_DATABASE_HOST: mongo
166       OSMLCM_MESSAGE_HOST: kafka
167     env_file:
168       - ./lcm.env
169     logging:
170       driver: "json-file"
171       options:
172         max-size: "100m"
173         max-file: "2"
174     #depends_on:
175     #  - kafka
176     #  - mongo
177     #  - ro
178   mysql:
179     image: mysql:5
180     networks:
181       netOSM:
182         aliases:
183           - ro-db
184     volumes:
185       - ro_db:/var/lib/mysql
186     env_file:
187       - ./ro-db.env
188     logging:
189       driver: "json-file"
190       options:
191         max-size: "100m"
192         max-file: "2"
193 #    ports:
194 #      - "3306:3306"
195   ro:
196     image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-9}
197     networks:
198       - netOSM
199     environment:
200       RO_DB_HOST: mysql
201       OSMRO_DATABASE_HOST: mongo
202       OSMRO_MESSAGE_HOST: kafka
203     env_file:
204       - ./ro.env
205     #depends_on:
206     #  - mongo
207     #  - kafka
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:-9}
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:-9}
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   grafana:
255     image: grafana/grafana
256     volumes:
257       - ./grafana/dashboards-osm.yml:/etc/grafana/provisioning/dashboards/dashboards-osm.yml
258       - ./grafana/osm-sample-dashboard.json:/etc/grafana/provisioning/dashboards/osm-sample-dashboard.json
259       - ./grafana/osm-system-dashboard.json:/etc/grafana/provisioning/dashboards/osm-system-dashboard.json
260       - ./grafana/datasource-prometheus.yml:/etc/grafana/provisioning/datasources/datasource-prometheus.yml
261     hostname: grafana
262     ports:
263       - "${OSM_GRAFANA_PORTS:-3000:3000}"
264     networks:
265       - netOSM
266     logging:
267       driver: "json-file"
268       options:
269         max-size: "100m"
270         max-file: "2"
271