c325776c668f3060b1c2d6411c3ba393a68a2665
[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   kafka:
48     image: wurstmeister/kafka:${KAFKA_TAG:-latest}
49     ports:
50       - "9092"
51     networks:
52       - netOSM
53     environment:
54       KAFKA_ADVERTISED_HOST_NAME: kafka
55       KAFKA_ADVERTISED_PORT: 9092
56       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
57       KAFKA_LOG_RETENTION_HOURS: 24
58     volumes:
59       - /var/run/docker.sock:/var/run/docker.sock
60     healthcheck:
61       test: zookeeper-shell.sh zookeeper:2181 ls /brokers/ids 2>&1 | grep "Node does not exist" && exit 1 || exit 0
62       interval: 20s
63       timeout: 10s
64       retries: 5
65     #depends_on:
66     #  - zookeeper
67   mongo:
68     image: mongo
69 #    ports:
70 #      - "27017:27017"
71     networks:
72       - netOSM
73     volumes:
74       - mongo_db:/data/db
75   prometheus:
76     image: prom/prometheus:${PROMETHEUS_TAG:-latest}
77     hostname: prometheus
78     ports:
79       - "${OSM_PROM_PORTS:-9091:9090}"
80     volumes:
81       - ./prometheus.yml:/etc/prometheus/prometheus.yml:ro
82       - prom_db:/prometheus
83     networks:
84       - netOSM
85   keystone:
86     image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-6}
87     networks:
88       - netOSM
89     environment:
90       DB_HOST: mysql
91     env_file:
92       - ./keystone.env
93     ports:
94       - "${OSM_KEYSTONE_PORTS:-5000:5000}"
95   nbi:
96     image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-6}
97     networks:
98       - netOSM
99     volumes:
100       - osm_packages:/app/storage
101     environment:
102       OSMNBI_DATABASE_HOST: mongo
103       OSMNBI_MESSAGE_HOST: kafka
104     env_file:
105       - ./nbi.env
106     ports:
107       - "${OSM_NBI_PORTS:-9999:9999}"
108     #depends_on:
109     #  - kafka
110     #  - mongo
111   lcm:
112     image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-6}
113     networks:
114       - netOSM
115     volumes:
116       - osm_packages:/app/storage
117     environment:
118       OSMLCM_RO_HOST: ro
119       OSMLCM_DATABASE_HOST: mongo
120       OSMLCM_MESSAGE_HOST: kafka
121     env_file:
122       - ./lcm.env
123     #depends_on:
124     #  - kafka
125     #  - mongo
126     #  - ro
127   mysql:
128     image: mysql:5
129     networks:
130       netOSM:
131         aliases:
132           - ro-db
133     volumes:
134       - ro_db:/var/lib/mysql
135     env_file:
136       - ./ro-db.env
137 #    ports:
138 #      - "3306:3306"
139   ro:
140     image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-6}
141     networks:
142       - netOSM
143     environment:
144       RO_DB_HOST: mysql
145     env_file:
146       - ./ro.env
147     #depends_on:
148     #  - mysql
149     volumes:
150       - ro:/var/log/osm
151     ports:
152       - "${OSM_RO_PORTS:-9090:9090}"
153   mon:
154     image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-6}
155     networks:
156       - netOSM
157     volumes:
158       - mon_db:/app/database
159     environment:
160       OSMMON_MESSAGE_HOST: kafka
161       OSMMON_MESSAGE_PORT: 9092
162     env_file:
163       - ./mon.env
164     ports:
165       - "${OSM_MON_PORTS:-8662:8662}"
166     #depends_on:
167     #  - kafka
168     logging:
169         driver: "json-file"
170         options:
171             max-file: 5
172             max-size: 10m
173   pol:
174     image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-6}
175     networks:
176       - netOSM
177     volumes:
178       - pol_db:/app/database
179     environment:
180       OSMPOL_MESSAGE_HOST: kafka
181       OSMPOL_MESSAGE_PORT: 9092
182     env_file:
183       - ./pol.env
184     #depends_on:
185     #  - kafka
186     #  - mon
187     logging:
188       driver: "json-file"
189       options:
190         max-file: 5
191         max-size: 10m
192   light-ui:
193     image: ${DOCKER_USER:-opensourcemano}/light-ui:${TAG:-6}
194     networks:
195       - netOSM
196     environment:
197       OSM_SERVER: nbi
198     #depends_on:
199     #  - nbi
200     env_file:
201       - ./lwui.env
202     ports:
203       - "${OSM_UI_PORTS:-80:80}"