Enable autocreation topic in kafka for POL and MON
[osm/devops.git] / installers / docker / docker-compose.yaml
index 82d0d09..950946a 100644 (file)
@@ -1,31 +1,82 @@
+##
+# Copyright 2019 ETSI
+#
+# Licensed under the Apache License, Version 2.0 (the "License"); you may
+# not use this file except in compliance with the License. You may obtain
+# a copy of the License at
+#
+#         http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+# License for the specific language governing permissions and limitations
+# under the License.
+##
+
+########################################################################
+
 version: '3'
 volumes:
-  OSMstorage:
+  ro:
+  ro_db:
+  mongo_db:
+  mon_db:
+  pol_db:
+  osm_packages:
+  prom_db:
 networks:
   netOSM:
-    external: true
+    external:
+      name: ${OSM_NETWORK:-netosm}
     #driver: overlay
     #driver_opts:
     #  com.docker.network.driver.mtu: "1446"
 services:
   zookeeper:
-    image: wurstmeister/zookeeper
+    image: wurstmeister/zookeeper:${ZOOKEEPER_TAG:-latest}
 #    ports:
 #      - "2181:2181"
     networks:
       - netOSM
+    healthcheck:
+      test: echo ruok | nc -w 2 localhost 2181
+      interval: 20s
+      timeout: 10s
+      retries: 5
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
   kafka:
-    image: wurstmeister/kafka
+    image: wurstmeister/kafka:${KAFKA_TAG:-latest}
     ports:
-      - "9092:9092"
+      - "9092"
     networks:
       - netOSM
     environment:
       KAFKA_ADVERTISED_HOST_NAME: kafka
       KAFKA_ADVERTISED_PORT: 9092
       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
+      KAFKA_LOG_RETENTION_HOURS: 24
+      KAFKA_BROKER_ID: 1
+      KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://:9092
+      KAFKA_LISTENERS: PLAINTEXT://:9092
+      KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
+      KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
     volumes:
       - /var/run/docker.sock:/var/run/docker.sock
+    healthcheck:
+      test: echo ruok | nc -w 2 zookeeper 2181
+      interval: 20s
+      timeout: 10s
+      retries: 5
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
     #depends_on:
     #  - zookeeper
   mongo:
@@ -34,85 +85,202 @@ services:
 #      - "27017:27017"
     networks:
       - netOSM
+    volumes:
+      - mongo_db:/data/db
+  prometheus:
+    image: prom/prometheus:${PROMETHEUS_TAG:-latest}
+    hostname: prometheus
+    ports:
+      - "${OSM_PROM_PORTS:-9091:9090}"
+    volumes:
+      - ./prometheus/:/etc/prometheus/
+      - prom_db:/prometheus
+    command:
+      - '--config.file=/etc/prometheus/prometheus.yml'
+      - '--web.enable-lifecycle'
+    networks:
+      - netOSM
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
+  prometheus-cadvisor:
+    image: google/cadvisor:${PROMETHEUS_CADVISOR_TAG:-latest}
+    ports:
+      - "${OSM_PROM_CADVISOR_PORTS:-8080:8080}"
+    volumes:
+      - /:/rootfs:ro
+      - /var/run:/var/run:ro
+      - /sys:/sys:ro
+      - /var/lib/docker/:/var/lib/docker:ro
+      - /dev/disk/:/dev/disk:ro
+    networks:
+      - netOSM
+  keystone:
+    image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-7}
+    networks:
+      - netOSM
+    environment:
+      DB_HOST: mysql
+    env_file:
+      - ./keystone.env
+    ports:
+      - "${OSM_KEYSTONE_PORTS:-5000:5000}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
   nbi:
-    image: osm/nbi
+    image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-7}
     networks:
       - netOSM
     volumes:
-      - OSMstorage:/app/storage
+      - osm_packages:/app/storage
     environment:
       OSMNBI_DATABASE_HOST: mongo
       OSMNBI_MESSAGE_HOST: kafka
+    env_file:
+      - ./nbi.env
     ports:
-      - "9999:9999"
+      - "${OSM_NBI_PORTS:-9999:9999}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
     #depends_on:
     #  - kafka
     #  - mongo
   lcm:
-    image: osm/lcm
+    image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-7}
     networks:
       - netOSM
     volumes:
-      - OSMstorage:/app/storage
+      - osm_packages:/app/storage
     environment:
       OSMLCM_RO_HOST: ro
       OSMLCM_DATABASE_HOST: mongo
       OSMLCM_MESSAGE_HOST: kafka
     env_file:
       - ./lcm.env
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
     #depends_on:
     #  - kafka
     #  - mongo
     #  - ro
-  ro-db:
-    image: mysql
+  mysql:
+    image: mysql:5
     networks:
-      - netOSM
+      netOSM:
+        aliases:
+          - ro-db
+    volumes:
+      - ro_db:/var/lib/mysql
     env_file:
       - ./ro-db.env
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
 #    ports:
 #      - "3306:3306"
   ro:
-    image: osm/ro
+    image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-7}
     networks:
       - netOSM
     environment:
-      RO_DB_HOST: ro-db
+      RO_DB_HOST: mysql
     env_file:
       - ./ro.env
     #depends_on:
-    #  - ro-db
+    #  - mysql
+    volumes:
+      - ro:/var/log/osm
     ports:
-      - "9090:9090"
+      - "${OSM_RO_PORTS:-9090:9090}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
   mon:
-    image: osm/mon
+    image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-7}
     networks:
       - netOSM
+    volumes:
+      - mon_db:/app/database
     environment:
-      BROKER_URI: kafka:9092
+      OSMMON_MESSAGE_HOST: kafka
+      OSMMON_MESSAGE_PORT: 9092
     env_file:
       - ./mon.env
+    ports:
+      - "${OSM_MON_PORTS:-8662:8662}"
     #depends_on:
     #  - kafka
-    ports:
-      - "8662:8662"
-  pm:
-    image: osm/pm
+    logging:
+        driver: "json-file"
+        options:
+            max-file: 5
+            max-size: 10m
+  pol:
+    image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-7}
     networks:
       - netOSM
+    volumes:
+      - pol_db:/app/database
     environment:
-      BROKER_URI: kafka:9092
+      OSMPOL_MESSAGE_HOST: kafka
+      OSMPOL_MESSAGE_PORT: 9092
+    env_file:
+      - ./pol.env
     #depends_on:
     #  - kafka
     #  - mon
+    logging:
+      driver: "json-file"
+      options:
+        max-file: 5
+        max-size: 10m
   light-ui:
-    image: osm/light-ui
+    image: ${DOCKER_USER:-opensourcemano}/light-ui:${TAG:-7}
     networks:
       - netOSM
     environment:
       OSM_SERVER: nbi
     #depends_on:
     #  - nbi
+    env_file:
+      - ./lwui.env
     ports:
-      - "80:80"
+      - "${OSM_UI_PORTS:-80:80}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
+  grafana:
+    image: grafana/grafana
+    volumes:
+      - ./grafana/dashboards-osm.yml:/etc/grafana/provisioning/dashboards/dashboards-osm.yml
+      - ./grafana/osm-sample-dashboard.json:/etc/grafana/provisioning/dashboards/osm-sample-dashboard.json
+      - ./grafana/osm-system-dashboard.json:/etc/grafana/provisioning/dashboards/osm-system-dashboard.json
+      - ./grafana/datasource-prometheus.yml:/etc/grafana/provisioning/datasources/datasource-prometheus.yml
+    hostname: grafana
+    ports:
+      - "${OSM_GRAFANA_PORTS:-3000:3000}"
+    networks:
+      - netOSM
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"