-
Notifications
You must be signed in to change notification settings - Fork 3
/
compose-1-instance-1-scheduler.yml
189 lines (186 loc) · 5.27 KB
/
compose-1-instance-1-scheduler.yml
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
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
version: '3.4'
services:
postgres-db:
image: postgres:16.2-alpine
restart: always
environment:
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=wO2VGDsMKR
- max_wal_size=2GB
ports:
- '5432:5432'
networks:
- network
volumes:
- postgres-db-16-2:/var/lib/postgresql/data-16-2
############################
# Workflow App + Dapr sidecar
############################
workflow-app-a:
environment:
- DAPR_HTTP_PORT=3500
- REGISTER_WORKFLOWS=true
- REGISTER_ACTIVITIES=true
build:
context: .
dockerfile: Workflow/Dockerfile
ports:
- "3500:3500" # only important so we can reach the Dapr HTTP sidecar from the host for testing purposes
- "5113:5111"
- "7777:7776"
depends_on:
- placement
networks:
- network
workflow-dapr-a:
image: "daprio/daprd:1.14.4"
command: ["./daprd",
"-app-id", "workflow-a",
"-app-port", "5111",
"-placement-host-address", "placement:50005",
"-scheduler-host-address", "scheduler-0:50006",
"-resources-path", "/components",
"-config", "/dapr-config/config.yml",
"-log-level","info",
"-enable-app-health-check", "true",
"-app-health-check-path", "/health",
"-app-health-probe-interval", "10",
"-app-health-probe-timeout", "1000",
"-app-health-threshold", "1"]
volumes:
- "./components/:/components"
- "./dapr-config/:/dapr-config"
depends_on:
postgres-db:
condition: service_started
kafka:
condition: service_healthy
network_mode: "service:workflow-app-a"
###########################
#Client App + Dapr sidecar
###########################
client-app:
build:
context: .
dockerfile: Client/Dockerfile
ports:
- "5112:5111"
- "3503:3500"
networks:
- network
client-dapr:
image: "daprio/daprd:1.14.4"
command: ["./daprd",
"-app-id", "client",
"-app-port", "5111",
"-dapr-http-port", "3500",
"-resources-path", "/components",
"-log-level","warn"]
volumes:
- "./components/:/components"
depends_on:
kafka:
condition: service_healthy
network_mode: "service:client-app"
############################
# Dapr placement service
############################
placement:
image: "daprio/dapr:1.14.4"
command: ["./placement",
"-port", "50005",
"-log-level","warn"]
networks:
- network
# ############################
# # Dapr Scheduler service
# ############################
scheduler-0:
image: "daprio/dapr:1.14.4"
command: ["./scheduler",
"--etcd-data-dir", "/var/run/dapr/scheduler",
"--initial-cluster", "scheduler-0=http://scheduler-0:2380",
"--replica-count", "1",
"--id","scheduler-0"
]
volumes:
- ./dapr_scheduler/0:/var/run/dapr/scheduler
networks:
- network
############################
# Zookeeper
############################
zookeeper:
image: confluentinc/cp-zookeeper:latest
networks:
- network
restart: unless-stopped
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
ALLOW_ANONYMOUS_LOGIN: "true"
ports:
- 2181:2181
volumes:
- zookeeper_logs:/var/lib/zookeeper/log
- zookeeper_data:/var/lib/zookeeper/data
############################
# Kafka
############################
kafka:
image: confluentinc/cp-kafka:latest
networks:
- network
restart: unless-stopped
depends_on:
- zookeeper
healthcheck:
test: nc -z localhost 9092 || exit -1
interval: 10s
retries: 10
timeout: 30s
start_period: 10s
ports:
- 9092:9092
- 29092:29092
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_LOG4J_ROOT_LOGLEVEL: ERROR
KAFKA_LOG4J_LOGGERS: org.apache.zookeeper=ERROR,org.apache.kafka=ERROR,kafka=ERROR,kafka.cluster=ERROR,kafka.controller=ERROR,kafka.coordinator=ERROR,kafka.log=ERROR,kafka.server=ERROR,kafka.zookeeper=ERROR,state.change.logger=ERROR
KAFKA_JMX_PORT: 9997
KAFKA_NUM_PARTITIONS: 10
############################
# Kafka UI
############################
kafka-ui:
container_name: kafka-ui
image: provectuslabs/kafka-ui:latest
ports:
- 8080:8080
depends_on:
- kafka
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092
KAFKA_CLUSTERS_0_METRICS_PORT: 9997
KAFKA_CLUSTERS_0_AUDIT_TOPICAUDITENABLED: 'true'
KAFKA_CLUSTERS_0_AUDIT_CONSOLEAUDITENABLED: 'true'
LOGGING_LEVEL_ROOT: 'error'
LOGGING_LEVEL_COM_PROVECTUS: 'error'
networks:
- network
networks:
network:
volumes:
db-data:
driver: local
zookeeper_logs:
driver: local
zookeeper_data:
driver: local
postgres-db-16-2:
driver: local