forked from flexprice/flexprice
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
198 lines (188 loc) · 5.59 KB
/
docker-compose.yml
File metadata and controls
198 lines (188 loc) · 5.59 KB
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
190
191
192
193
194
195
196
197
198
services:
postgres:
image: postgres:17
ports:
- 127.0.0.1:5432:5432
environment:
POSTGRES_USER: flexprice
POSTGRES_PASSWORD: flexprice123
POSTGRES_DB: flexprice
volumes:
- ./init-temporal-db.sh:/docker-entrypoint-initdb.d/init-temporal-db.sh
- ./migrations/postgres:/docker-entrypoint-initdb.d/
- postgres-data:/var/lib/postgresql/data
healthcheck:
test: pg_isready -U flexprice -d flexprice
interval: 5s
timeout: 3s
retries: 100
kafka:
image: confluentinc/cp-kafka:7.7.1
ports:
- "127.0.0.1:29092:29092"
environment:
CLUSTER_ID: ca497efe-9f82-4b84-890b-d9969a9a2e1c
KAFKA_BROKER_ID: 0
KAFKA_PROCESS_ROLES: "broker,controller"
KAFKA_CONTROLLER_QUORUM_VOTERS: "0@kafka:9093"
KAFKA_CONTROLLER_LISTENER_NAMES: CONTROLLER
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT,CONTROLLER:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9092,EXTERNAL://localhost:29092
KAFKA_LISTENERS: INTERNAL://kafka:9092,EXTERNAL://0.0.0.0:29092,CONTROLLER://kafka:9093
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_AUTO_CREATE_TOPICS_ENABLE: "false"
volumes:
- kafka-data:/var/lib/kafka/data
healthcheck:
test: ["CMD-SHELL", "kafka-topics --bootstrap-server kafka:9092 --list"]
interval: 5s
timeout: 3s
retries: 30
clickhouse:
image: clickhouse/clickhouse-server:24.9-alpine
ports:
- "127.0.0.1:8123:8123"
- "127.0.0.1:9000:9000"
- "127.0.0.1:9009:9009"
environment:
CLICKHOUSE_USER: flexprice
CLICKHOUSE_PASSWORD: flexprice123
CLICKHOUSE_DB: flexprice
CLICKHOUSE_DEFAULT_ACCESS_MANAGEMENT: 1
volumes:
- clickhouse-data:/var/lib/clickhouse
ulimits:
nofile:
soft: 262144
hard: 262144
healthcheck:
test: ["CMD", "wget", "--spider", "http://clickhouse:8123/ping"]
interval: 5s
timeout: 3s
retries: 30
kafka-ui:
image: ghcr.io/kafbat/kafka-ui:main
profiles:
- dev
depends_on:
- kafka
ports:
- "127.0.0.1:8084:8080"
environment:
KAFKA_CLUSTERS_0_NAME: local
KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:9092
DYNAMIC_CONFIG_ENABLED: "true"
healthcheck:
test: ["CMD", "wget", "--spider", "http://kafka-ui:8080/"]
interval: 10s
timeout: 5s
retries: 30
temporal:
image: temporalio/auto-setup:1.26.2
ports:
- "7233:7233"
environment:
- ENABLE_ES=false
- DB=postgres12
- DB_PORT=5432
- DB_USER=flexprice
- DB_PWD=flexprice123
- DB_NAME=temporal
- DB_HOST=postgres
- POSTGRES_USER=flexprice
- POSTGRES_PWD=flexprice123
- POSTGRES_SEEDS=postgres
- TEMPORAL_PERSISTENCE_SCHEMA_DIR=/etc/temporal/schema/postgresql/v96/temporal/versioned
depends_on:
postgres:
condition: service_healthy
temporal-ui:
image: temporalio/ui:2.31.2
ports:
- "127.0.0.1:8088:8080"
environment:
- TEMPORAL_ADDRESS=temporal:7233
depends_on:
- temporal
# Build stage as a separate service that other services can depend on
flexprice-build:
image: flexprice-app:local
build:
context: .
dockerfile: Dockerfile.local
profiles:
- build-only
command: ["echo", "Build complete"]
flexprice-api:
image: flexprice-app:local
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_healthy
clickhouse:
condition: service_healthy
temporal:
condition: service_started
ports:
- "127.0.0.1:8080:8080"
environment:
- FLEXPRICE_DEPLOYMENT_MODE=api
# Override config.yaml settings for containerized environment
- FLEXPRICE_POSTGRES_HOST=postgres
- FLEXPRICE_KAFKA_BROKERS=kafka:9092
- FLEXPRICE_CLICKHOUSE_ADDRESS=clickhouse:9000
- FLEXPRICE_TEMPORAL_ADDRESS=temporal:7233
volumes:
- ./internal/config:/app/config
restart: unless-stopped
flexprice-consumer:
image: flexprice-app:local
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_healthy
clickhouse:
condition: service_healthy
temporal:
condition: service_started
environment:
- FLEXPRICE_DEPLOYMENT_MODE=consumer
# Override config.yaml settings for containerized environment
- FLEXPRICE_POSTGRES_HOST=postgres
- FLEXPRICE_KAFKA_BROKERS=kafka:9092
- FLEXPRICE_CLICKHOUSE_ADDRESS=clickhouse:9000
- FLEXPRICE_TEMPORAL_ADDRESS=temporal:7233
volumes:
- ./internal/config:/app/config
restart: unless-stopped
flexprice-worker:
image: flexprice-app:local
depends_on:
postgres:
condition: service_healthy
kafka:
condition: service_healthy
clickhouse:
condition: service_healthy
temporal:
condition: service_started
environment:
- FLEXPRICE_DEPLOYMENT_MODE=temporal_worker
# Override config.yaml settings for containerized environment
- FLEXPRICE_POSTGRES_HOST=postgres
- FLEXPRICE_KAFKA_BROKERS=kafka:9092
- FLEXPRICE_CLICKHOUSE_ADDRESS=clickhouse:9000
- FLEXPRICE_TEMPORAL_ADDRESS=temporal:7233
volumes:
- ./internal/config:/app/config
restart: unless-stopped
volumes:
postgres-data:
kafka-data:
clickhouse-data: