6675e97c78633ea77867f305f2f30dc3ae5d4ef5
[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     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   keystone:
101     image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-6}
102     networks:
103       - netOSM
104     environment:
105       DB_HOST: mysql
106     env_file:
107       - ./keystone.env
108     ports:
109       - "${OSM_KEYSTONE_PORTS:-5000:5000}"
110     logging:
111       driver: "json-file"
112       options:
113         max-size: "100m"
114         max-file: "2"
115   nbi:
116     image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-6}
117     networks:
118       - netOSM
119     volumes:
120       - osm_packages:/app/storage
121     environment:
122       OSMNBI_DATABASE_HOST: mongo
123       OSMNBI_MESSAGE_HOST: kafka
124     env_file:
125       - ./nbi.env
126     ports:
127       - "${OSM_NBI_PORTS:-9999:9999}"
128     logging:
129       driver: "json-file"
130       options:
131         max-size: "100m"
132         max-file: "2"
133     #depends_on:
134     #  - kafka
135     #  - mongo
136   lcm:
137     image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-6}
138     networks:
139       - netOSM
140     volumes:
141       - osm_packages:/app/storage
142     environment:
143       OSMLCM_RO_HOST: ro
144       OSMLCM_DATABASE_HOST: mongo
145       OSMLCM_MESSAGE_HOST: kafka
146     env_file:
147       - ./lcm.env
148     logging:
149       driver: "json-file"
150       options:
151         max-size: "100m"
152         max-file: "2"
153     #depends_on:
154     #  - kafka
155     #  - mongo
156     #  - ro
157   mysql:
158     image: mysql:5
159     networks:
160       netOSM:
161         aliases:
162           - ro-db
163     volumes:
164       - ro_db:/var/lib/mysql
165     env_file:
166       - ./ro-db.env
167     logging:
168       driver: "json-file"
169       options:
170         max-size: "100m"
171         max-file: "2"
172 #    ports:
173 #      - "3306:3306"
174   ro:
175     image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-6}
176     networks:
177       - netOSM
178     environment:
179       RO_DB_HOST: mysql
180     env_file:
181       - ./ro.env
182     #depends_on:
183     #  - mysql
184     volumes:
185       - ro:/var/log/osm
186     ports:
187       - "${OSM_RO_PORTS:-9090:9090}"
188     logging:
189       driver: "json-file"
190       options:
191         max-size: "100m"
192         max-file: "2"
193   mon:
194     image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-6}
195     networks:
196       - netOSM
197     volumes:
198       - mon_db:/app/database
199     environment:
200       OSMMON_MESSAGE_HOST: kafka
201       OSMMON_MESSAGE_PORT: 9092
202     env_file:
203       - ./mon.env
204     ports:
205       - "${OSM_MON_PORTS:-8662:8662}"
206     #depends_on:
207     #  - kafka
208     logging:
209         driver: "json-file"
210         options:
211             max-file: 5
212             max-size: 10m
213   pol:
214     image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-6}
215     networks:
216       - netOSM
217     volumes:
218       - pol_db:/app/database
219     environment:
220       OSMPOL_MESSAGE_HOST: kafka
221       OSMPOL_MESSAGE_PORT: 9092
222     env_file:
223       - ./pol.env
224     #depends_on:
225     #  - kafka
226     #  - mon
227     logging:
228       driver: "json-file"
229       options:
230         max-file: 5
231         max-size: 10m
232   light-ui:
233     image: ${DOCKER_USER:-opensourcemano}/light-ui:${TAG:-6}
234     networks:
235       - netOSM
236     environment:
237       OSM_SERVER: nbi
238     #depends_on:
239     #  - nbi
240     env_file:
241       - ./lwui.env
242     ports:
243       - "${OSM_UI_PORTS:-80:80}"
244     logging:
245       driver: "json-file"
246       options:
247         max-size: "100m"
248         max-file: "2"