-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yaml
172 lines (170 loc) · 5.02 KB
/
docker-compose.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
version: '3.8'
networks:
test-network:
name: test-network
driver: bridge
ipam:
driver: default
config:
- subnet: 172.100.10.0/24
services:
mosquitto:
image: eclipse-mosquitto:2
hostname: mosquitto
container_name: mosquitto
expose:
- "1883"
ports:
- "1883:1883"
- "9001:9001"
volumes:
- ./mosquitto/config/mosquitto.conf:/mosquitto/config/mosquitto.conf
- ./mosquitto/data:/mosquitto/data
- ./mosquitto/log:/mosquitto/log
networks:
test-network:
ipv4_address: 172.100.10.5
generator:
build:
context: ./go-generator
dockerfile: Dockerfile
environment:
GENERATOR_BROKER_ADDRESS: 172.100.10.5:1883
GENERATOR_TOPIC: farm_id/device_id/testclient1
GENERATOR_NUM_DEVICES: "5"
GENERATOR_PUBLISH_TIMEOUT_MS: "1000"
restart: always
stdin_open: true
tty: true
depends_on:
- mosquitto
networks:
test-network:
ipv4_address: 172.100.10.6
zookeeper:
image: zookeeper:3.4.9
restart: unless-stopped
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
ZOO_MY_ID: 1
ZOO_PORT: 2181
ZOO_SERVERS: server.1=zookeeper:2888:3888
volumes:
- ./zookeeper/data:/data
- ./zookeeper/datalog:/datalog
networks:
test-network:
ipv4_address: 172.100.10.10
kafka:
image: confluentinc/cp-kafka:5.1.0
hostname: kafka
container_name: kafka
ports:
- "9092:9092"
environment:
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_BROKER_ID: 1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_CREATE_TOPICS: "realtime-data:1:1"
volumes:
- ./kafka/data:/var/lib/kafka/data
depends_on:
- zookeeper
networks:
test-network:
ipv4_address: 172.100.10.11
kafka-connect:
# image: confluentinc/cp-kafka-connect:latest
build:
context: ./kafka-connect
dockerfile: Dockerfile
restart: always
environment:
CONNECT_BOOTSTRAP_SERVERS: 172.100.10.11:9092
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: compose-connect-group
CONNECT_CONFIG_STORAGE_TOPIC: docker-connect-config
CONNECT_OFFSET_STORAGE_TOPIC: docker-connect-offsets
CONNECT_STATUS_STORAGE_TOPIC: docker-connect-status
CONNECT_CONFIG_STORAGE_REPLICATION_FACTOR: 1
CONNECT_OFFSET_STORAGE_REPLICATION_FACTOR: 1
CONNECT_STATUS_STORAGE_REPLICATION_FACTOR: 1
CONNECT_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_INTERNAL_KEY_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_INTERNAL_VALUE_CONVERTER: org.apache.kafka.connect.json.JsonConverter
CONNECT_REST_ADVERTISED_HOST_NAME: localhost
CONNECT_LOG4J_ROOT_LOGLEVEL: DEBUG
CONNECT_KEY_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
CONNECT_VALUE_CONVERTER_SCHEMA_REGISTRY_URL: http://schema-registry:8081
# CONNECT_PLUGIN_PATH: /usr/share/java,/etc/kafka-connect/jars
# volumes:
# - ./kafka-connect/jars/:/etc/kafka-connect/jars
ports:
- "8083:8083"
networks:
test-network:
ipv4_address: 172.100.10.12
schema-registry:
image: confluentinc/cp-schema-registry:latest
restart: always
environment:
SCHEMA_REGISTRY_KAFKASTORE_CONNECTION_URL: zookeeper:2181
SCHEMA_REGISTRY_HOST_NAME: schema-registry
SCHEMA_REGISTRY_LISTENERS: http://schema-registry:8081,http://localhost:8081
depends_on: [zookeeper, kafka]
networks:
test-network:
ipv4_address: 172.100.10.15
ingestor:
build:
context: ./go-ingestor
dockerfile: Dockerfile
environment:
CONFIG_FILE: /config/config.yaml
volumes:
- ./go-ingestor/config/config.yaml:/config/config.yaml
restart: always
hostname: ingestor
container_name: ingestor
depends_on:
- zookeeper
- kafka
networks:
test-network:
ipv4_address: 172.100.10.13
# timescaledb:
# image: timescale/timescaledb-ha:pg15-latest
postgres:
image: debezium/postgres
restart: always
healthcheck:
test: "pg_isready -U admin -d tcc_icmc"
interval: 1s
timeout: 20s
retries: 10
ports:
- "5432:5432"
environment:
POSTGRES_USER: admin
POSTGRES_PASSWORD: admin
volumes:
- ./postgresql/sql/020_init.sql:/docker-entrypoint-initdb.d/020_init.sql
- ./postgresql/sql/021_insert_data.sql:/docker-entrypoint-initdb.d/021_insert_data.sql
# - ./postgresql/data:/var/lib/postgresql/data/
networks:
test-network:
ipv4_address: 172.100.10.20
adminer:
image: adminer
restart: always
ports:
- "8080:8080"
networks:
test-network:
ipv4_address: 172.100.10.21