-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-compose.yml
220 lines (204 loc) · 6.24 KB
/
docker-compose.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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
version: '2'
services:
rabbitmq:
image: rabbitmq:3.9.9-management
hostname: rabbitmq
container_name: rabbitmq
ports:
- "15672:15672" # web console port
- "5672:5672" # AMQP port
environment:
RABBITMQ_DEFAULT_USER: guest
RABBITMQ_DEFAULT_PASS: guest
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
hostname: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
networks:
ecommerce-network:
ipv4_address: 172.18.0.100
kafka:
image: confluentinc/cp-kafka:7.3.0
hostname: kafka
container_name: kafka
depends_on:
- zookeeper
ports:
- "29092:29092"
- "9092:9092"
- "9101:9101"
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: 'zookeeper:2181'
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:29092,PLAINTEXT_HOST://127.0.0.1:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
KAFKA_GROUP_INITIAL_REBALANCE_DELAY_MS: 0
KAFKA_JMX_PORT: 9101
KAFKA_JMX_HOSTNAME: localhost
networks:
ecommerce-network:
ipv4_address: 172.18.0.101
kafka-connect:
image: confluentinc/cp-kafka-connect:7.0.1
ports:
- 8083:8083
container_name: kafka-connect
environment:
CONNECT_BOOTSTRAP_SERVERS: kafka:29092
CONNECT_REST_PORT: 8083
CONNECT_GROUP_ID: "quickstart-avro"
CONNECT_CONFIG_STORAGE_TOPIC: "quickstart-avro-config"
CONNECT_OFFSET_STORAGE_TOPIC: "quickstart-avro-offsets"
CONNECT_STATUS_STORAGE_TOPIC: "quickstart-avro-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: WARN
CONNECT_PLUGIN_PATH: "/usr/share/java,/etc/kafka-connect/jars"
depends_on:
- mariadb
- kafka
volumes:
- ./docker-data-files/lib:/etc/kafka-connect/jars # https://www.confluent.io/hub/confluentinc/kafka-connect-jdbc에서 다운 받고 lib/하위의 jar 파일들을 lib폴더하위로 복사
networks:
- ecommerce-network
kafka-ui:
image: provectuslabs/kafka-ui:latest
container_name: kafka-ui
ports:
- "8080:8080"
environment:
KAFKA_CLUSTERS_0_NAME: "local-kafka"
KAFKA_CLUSTERS_0_BOOTSTRAP_SERVERS: "kafka:29092"
KAFKA_CLUSTERS_0_ZOOKEEPER_CONNECT: "zookeeper:2181"
depends_on:
- kafka
- zookeeper
networks:
- ecommerce-network
mariadb:
image: mariadb
container_name: kafka-mariadb
ports:
- "3306:3306"
environment:
MYSQL_ROOT_PASSWORD: root
TZ: Asia/Seoul
command: >
--character-set-server=utf8mb4
--collation-server=utf8mb4_unicode_ci
--init-file /docker-entrypoint-initdb.d/init.sql
volumes:
- ./docker-data-files/database/init.sql:/docker-entrypoint-initdb.d/init.sql
networks:
- ecommerce-network
zipkin:
image: openzipkin/zipkin
container_name: zipkin
ports:
- "9411:9411"
networks:
- ecommerce-network
prometheus:
image: prom/prometheus:latest
container_name: prometheus
ports:
- "9090:9090"
volumes:
- ./docker-config/prometheus.yml:/etc/prometheus/prometheus.yml
networks:
- ecommerce-network
grafana:
image: grafana/grafana:latest
container_name: my-grafana
user: "$UID:$GID"
ports:
- "3000:3000"
volumes:
- ./docker-data-files/grafana-data:/var/lib/grafana
depends_on:
- prometheus
networks:
- ecommerce-network
config-service:
image: ydj515/config-service:1.0
container_name: config-service
ports:
- "8888:8888"
environment:
spring.rabbitmq.host: rabbitmq
spring.profiles.active: default
networks:
- ecommerce-network
discovery-service:
image: ydj515/discovery-service:1.0
container_name: discovery-service
ports:
- "8761:8761"
environment:
spring.cloud.config.uri: config-service:8888
spring.profiles.active: default
networks:
- ecommerce-network
api-gateway-service:
image: ydj515/api-gateway-service:1.0
container_name: api-gateway-service
ports:
- "8000:8000"
environment:
spring.cloud.config.uri: config-service:8888
spring.rabbitmq.host: rabbitmq
eureka.client.serviceUrl.defaultZone: discovery-service:8761/eureka/
networks:
- ecommerce-network
user-service:
image: ydj515/user-service:1.0
container_name: user-service
environment:
spring.cloud.config.uri: config-service:8888
spring.rabbitmq.host: rabbitmq
spring.zipkin.base-url: zipkin:9411
eureka.client.serviceUrl.defaultZone: discovery-service:8761/eureka/
logging.file: /api-logs/users-ws.log
networks:
- ecommerce-network
order-service:
image: ydj515/order-service:1.0
container_name: order-service
environment:
spring.cloud.config.uri: config-service:8888
spring.rabbitmq.host: rabbitmq
spring.zipkin.base-url: zipkin:9411
eureka.client.serviceUrl.defaultZone: discovery-service:8761/eureka/
logging.file: /api-logs/orders-ws.log
networks:
- ecommerce-network
catalog-service:
image: ydj515/catalog-service:1.0
container_name: catalog-service
environment:
spring.cloud.config.uri: config-service:8888
eureka.client.serviceUrl.defaultZone: discovery-service:8761/eureka/
logging.file: /api-logs/catalogs-ws.log
networks:
- ecommerce-network
networks:
ecommerce-network:
driver: bridge
ipam:
driver: default
config:
- subnet: 172.18.0.0/16