Merge "Add common docker-compose.yml"
[oam.git] / solution / operation-and-maintenance / smo / common / docker-compose.yml
1 ################################################################################
2 # Copyright 2022 highstreet technologies GmbH
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain 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,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 version: '3.8'
17 services:
18
19   identity:
20     image: ${IDENTITY_IMAGE}
21     container_name: identity
22     ports:
23       - ${IDENTITY_PORT}:8443
24     environment:
25       - KEYCLOAK_USER=${ADMIN_USERNAME}
26       - KEYCLOAK_PASSWORD=${ADMIN_PASSWORD}
27       - JAVA_OPTS=-Djboss.bind.address.private=[::1] -Djboss.bind.address=[::1] -Djava.net.preferIPv6Addresses=true -Djava.net.preferIPv4Stack=false
28       - DB_VENDOR=h2
29     networks:
30       dmz:
31
32   persistence:
33     image: ${PERSISTENCE_IMAGE}
34     container_name: persistence
35     environment:
36       - discovery.type=single-node
37
38   zookeeper:
39     image: ${ZOOKEEPER_IMAGE}
40     container_name: zookeeper
41     ports:
42       - 2181:2181
43     environment:
44       ZOOKEEPER_REPLICAS: 1
45       ZOOKEEPER_TICK_TIME: 2000
46       ZOOKEEPER_SYNC_LIMIT: 5
47       ZOOKEEPER_INIT_LIMIT: 10
48       ZOOKEEPER_MAX_CLIENT_CNXNS: 200
49       ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3
50       ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24
51       ZOOKEEPER_CLIENT_PORT: 2181
52       KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl
53       ZOOKEEPER_SERVER_ID:
54     volumes:
55       -  ./zookeeper/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
56
57   kafka:
58     image: ${KAFKA_IMAGE}
59     container_name: kafka
60     ports:
61      - 9092:9092
62     environment:
63       enableCadi: 'false'
64       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
65       KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000
66       KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000
67       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT
68       KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092
69       KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092
70       KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT
71       KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
72       KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf
73       KAFKA_ZOOKEEPER_SET_ACL: 'true'
74       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
75       # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment
76       KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1
77     volumes:
78       -  ./kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
79     depends_on:
80      - zookeeper
81
82   dmaap:
83     container_name: onap-dmaap
84     image: ${DMAAP_IMAGE}
85     ports:
86       - 3904:3904
87       - 3905:3905
88     environment:
89       enableCadi: 'false'
90     volumes:
91       - ./dmaap/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
92       - ./dmaap/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml
93       - ./dmaap/cadi.properties:/appl/dmaapMR1/etc/cadi.properties
94     depends_on:
95       - zookeeper
96       - kafka
97
98 networks:
99   dmz:
100     driver: bridge
101     name: dmz
102     enable_ipv6: false
103   default:
104     driver: bridge
105     name: smo
106     enable_ipv6: true
107     ipam:
108       driver: default
109       config:
110       - subnet:  ${NETWORK_SUBNET_SMO}
111         gateway: ${NETWORK_GATEWAY_SMO}