Merge "Add docker compose user environment variables"
[cps/cps-temporal.git] / docker-compose.yml
1 # ============LICENSE_START=======================================================
2 # Copyright (C) 2021 Nordix Foundation.
3 # Modifications Copyright (C) 2021 Bell Canada.
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
20 version: "3.7"
21
22 services:
23
24   cps-temporal:
25     container_name: cps-temporal
26     image: onap/cps-temporal:latest
27     ports:
28       - '8082:8080'
29     environment:
30       DB_HOST: timescaledb
31       DB_PORT: 5432
32       DB_USERNAME: cpstemporal
33       DB_PASSWORD: cpstemporal
34       APP_USERNAME: ${APP_USERNAME:-cpsuser}
35       APP_PASSWORD: ${APP_PASSWORD:-cpsr0cks!}
36       KAFKA_BOOTSTRAP_SERVER: kafka:9092
37
38     restart: unless-stopped
39     depends_on:
40       - timescaledb
41       - kafka
42
43   timescaledb:
44     container_name: timescaledb
45     image: timescale/timescaledb:2.1.1-pg13
46     ports:
47       - '5433:5432'
48     environment:
49       POSTGRES_DB: cpstemporaldb
50       POSTGRES_USER: cpstemporal
51       POSTGRES_PASSWORD: cpstemporal
52
53   zookeeper:
54     image: confluentinc/cp-zookeeper:6.1.1
55     container_name: zookeeper
56     environment:
57       ZOOKEEPER_CLIENT_PORT: 2181
58
59   kafka:
60     image: confluentinc/cp-kafka:6.1.1
61     container_name: kafka
62     ports:
63       - "19092:19092"
64     depends_on:
65       - zookeeper
66     environment:
67       KAFKA_BROKER_ID: 1
68       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
69       KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,CONNECTIONS_FROM_HOST://localhost:19092
70       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,CONNECTIONS_FROM_HOST:PLAINTEXT
71       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1