Support for kafka within xacml tutorial
[policy/xacml-pdp.git] / tutorials / tutorial-xacml-application / src / main / docker / docker-compose.yml
1 # ============LICENSE_START=======================================================
2 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
3 #  Modifications Copyright (C) 2022, 2024 Nordix Foundation.
4 # ================================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 #
17 # SPDX-License-Identifier: Apache-2.0
18 # ============LICENSE_END=========================================================
19 version: '3'
20 services:
21   mariadb:
22     image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER}
23     container_name: mariadb
24     hostname: mariadb
25     command: [ '--lower-case-table-names=1', '--wait_timeout=28800' ]
26     env_file: config/db/db.conf
27     volumes:
28       - ./config/db:/docker-entrypoint-initdb.d
29     expose:
30       - 3306
31   api:
32     image: ${CONTAINER_LOCATION}onap/policy-api:${POLICY_API_VERSION}
33     container_name: policy-api
34     depends_on:
35       - mariadb
36     hostname: policy-api
37     ports:
38       - "6767:6969"
39     expose:
40       - 6767
41   pap:
42     image: ${CONTAINER_LOCATION}onap/policy-pap:${POLICY_PAP_VERSION}
43     container_name: policy-pap
44     depends_on:
45       - mariadb
46       - kafka
47       - api
48     hostname: policy-pap
49     ports:
50       - "6868:6969"
51     expose:
52       - 6868
53   xacml-pdp:
54     image: onap/policy-xacml-tutorial:${POLICY_XACML_TUTORIAL_VERSION}
55     container_name: policy-xacml-pdp
56     depends_on:
57       - mariadb
58       - pap
59     hostname: policy-xacml-pdp
60     ports:
61       - "6969:6969"
62     expose:
63       - 6969
64   start_dependencies:
65     image: dadarek/wait-for-dependencies
66     environment:
67       TIMEOUT_LENGTH: 60
68     container_name: policy-wait
69     depends_on:
70       - mariadb
71       - kafka
72     hostname: policy-wait
73     command:
74       mariadb:3306
75       kafka:9092
76   start_all:
77     image: dadarek/wait-for-dependencies
78     environment:
79       TIMEOUT_LENGTH: 60
80     container_name: policy-wait-all
81     depends_on:
82       - mariadb
83       - kafka
84       - api
85       - pap
86       - xacml-pdp
87     hostname: policy-wait-all
88     command:
89       mariadb:3306
90       kafka:9092
91       api:6969
92       pap:6969
93       xacml-pdp:6969
94   zookeeper:
95     image: confluentinc/cp-zookeeper:latest
96     environment:
97       ZOOKEEPER_CLIENT_PORT: 2181
98       ZOOKEEPER_TICK_TIME: 2000
99     ports:
100       - "2181:2181"
101   kafka:
102     image: confluentinc/cp-kafka:latest
103     container_name: kafka
104     depends_on:
105       - zookeeper
106     networks:
107       default:
108         aliases:
109           - message-router
110     ports:
111       - "29092:29092"
112       - "9092:9092"
113     environment:
114       KAFKA_BROKER_ID: 1
115       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
116       KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
117       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
118       KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
119       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1